aboutsummaryrefslogtreecommitdiff
path: root/backend/include/rcc/TableGen/Record.h
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 17:28:49 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-16 17:28:49 +0800
commit864a29abbdce86353ec91c3587757711d3a42f10 (patch)
tree772390cad70fe8e47044f5c921174b254bd8297a /backend/include/rcc/TableGen/Record.h
parentca25d25d4c5131491a50b1a94e63e9b2d3c34ed4 (diff)
downloadrcc-project-864a29abbdce86353ec91c3587757711d3a42f10.tar.gz
rcc-project-864a29abbdce86353ec91c3587757711d3a42f10.tar.xz
[RISCV][GlobalISel] Generate integer comparisons
Diffstat (limited to 'backend/include/rcc/TableGen/Record.h')
-rw-r--r--backend/include/rcc/TableGen/Record.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/backend/include/rcc/TableGen/Record.h b/backend/include/rcc/TableGen/Record.h
index 4378af8..57e5832 100644
--- a/backend/include/rcc/TableGen/Record.h
+++ b/backend/include/rcc/TableGen/Record.h
@@ -237,17 +237,40 @@ struct SourceSelectionIntegerPredicate final {
struct SourceSelectionOperandDefConstantPredicate final {
std::uint32_t OperandIndex = 0;
- std::int64_t Value = 0;
+ struct ConstantRange final {
+ std::int64_t Minimum = 0;
+ std::int64_t Maximum = 0;
+ TextRange SourceRange;
+ };
+
+ std::vector<ConstantRange> Ranges;
+ TextRange Range;
+};
+
+struct SourceSelectionTemporary final {
+ std::string Symbol;
+ std::uint32_t TypeFromOperand = 0;
TextRange Range;
};
struct SourceSelectionOperandRenderer final {
std::optional<std::uint32_t> OperandIndex;
std::string PhysicalRegisterSymbol;
+ std::string TemporarySymbol;
+ std::optional<std::uint32_t> CapturedImmediateOperand;
+ std::optional<std::int64_t> Immediate;
+ std::string ImmediateTransform;
std::vector<std::string> Flags;
TextRange Range;
};
+struct SourceSelectionAction final {
+ std::string ResultOpcodeSymbol;
+ bool ReplacesRoot = false;
+ std::vector<SourceSelectionOperandRenderer> OperandRenderers;
+ TextRange Range;
+};
+
struct SourceSelectionRule final {
std::string Symbol;
std::uint32_t Priority = 0;
@@ -258,9 +281,8 @@ struct SourceSelectionRule final {
std::vector<SourceSelectionOperandBankPredicate> OperandBanks;
std::vector<SourceSelectionOperandClassPredicate> OperandClasses;
std::vector<SourceSelectionOperandDefConstantPredicate> OperandDefConstants;
- std::string ResultOpcodeSymbol;
- std::optional<std::vector<SourceSelectionOperandRenderer>> OperandRenderers;
- std::vector<std::int64_t> AppendedImmediates;
+ std::vector<SourceSelectionTemporary> Temporaries;
+ std::vector<SourceSelectionAction> Actions;
std::vector<std::uint32_t> EraseOperandDefinitions;
TextRange Range;
};