diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 16:13:12 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-16 16:13:12 +0800 |
| commit | ca25d25d4c5131491a50b1a94e63e9b2d3c34ed4 (patch) | |
| tree | 995b2f5e2a1312bced1d899be4fd87f95e49c73b /backend/include/rcc | |
| parent | 4f7b41c3c711d6c6fa4e422f3eec8961c91eea7a (diff) | |
| download | rcc-project-ca25d25d4c5131491a50b1a94e63e9b2d3c34ed4.tar.gz rcc-project-ca25d25d4c5131491a50b1a94e63e9b2d3c34ed4.tar.xz | |
[RISCV][GlobalISel] Select comparisons against zero
Diffstat (limited to 'backend/include/rcc')
| -rw-r--r-- | backend/include/rcc/CodeGen/GlobalISel/GIMatchTableExecutor.h | 5 | ||||
| -rw-r--r-- | backend/include/rcc/TableGen/Record.h | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/backend/include/rcc/CodeGen/GlobalISel/GIMatchTableExecutor.h b/backend/include/rcc/CodeGen/GlobalISel/GIMatchTableExecutor.h index 807cb4a..7cceca3 100644 --- a/backend/include/rcc/CodeGen/GlobalISel/GIMatchTableExecutor.h +++ b/backend/include/rcc/CodeGen/GlobalISel/GIMatchTableExecutor.h @@ -27,8 +27,13 @@ enum class GIMatchTableOpcode : std::uint8_t { CheckOperandType, CheckOperandBank, CheckOperandClass, + CheckIntegerPredicate, + CheckOperandDefConstant, MutateOpcode, + RenderOperand, + RenderPhysicalRegister, AppendImmediate, + EraseOperandDefinition, Complete, }; diff --git a/backend/include/rcc/TableGen/Record.h b/backend/include/rcc/TableGen/Record.h index 94308c7..4378af8 100644 --- a/backend/include/rcc/TableGen/Record.h +++ b/backend/include/rcc/TableGen/Record.h @@ -229,16 +229,39 @@ struct SourceSelectionOperandClassPredicate final { TextRange Range; }; +struct SourceSelectionIntegerPredicate final { + std::uint32_t OperandIndex = 0; + std::string Predicate; + TextRange Range; +}; + +struct SourceSelectionOperandDefConstantPredicate final { + std::uint32_t OperandIndex = 0; + std::int64_t Value = 0; + TextRange Range; +}; + +struct SourceSelectionOperandRenderer final { + std::optional<std::uint32_t> OperandIndex; + std::string PhysicalRegisterSymbol; + std::vector<std::string> Flags; + TextRange Range; +}; + struct SourceSelectionRule final { std::string Symbol; std::uint32_t Priority = 0; std::string MatchOpcodeSymbol; std::optional<SourceSelectionTypePredicate> ResultType; + std::optional<SourceSelectionIntegerPredicate> IntegerPredicate; std::vector<SourceSelectionOperandTypePredicate> OperandTypes; 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<std::uint32_t> EraseOperandDefinitions; TextRange Range; }; |
