From 864a29abbdce86353ec91c3587757711d3a42f10 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 16 Aug 2026 17:28:49 +0800 Subject: [RISCV][GlobalISel] Generate integer comparisons --- backend/utils/TableGen/Common/CodeGenTarget.h | 35 ++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'backend/utils/TableGen/Common/CodeGenTarget.h') diff --git a/backend/utils/TableGen/Common/CodeGenTarget.h b/backend/utils/TableGen/Common/CodeGenTarget.h index bee814f..42a28c1 100644 --- a/backend/utils/TableGen/Common/CodeGenTarget.h +++ b/backend/utils/TableGen/Common/CodeGenTarget.h @@ -195,19 +195,47 @@ struct NormalizedSelectionIntegerPredicate final { }; struct NormalizedSelectionOperandDefConstantPredicate final { + struct Range final { + std::int64_t Minimum = 0; + std::int64_t Maximum = 0; + }; + std::uint32_t OperandIndex = 0; - std::int64_t Value = 0; + std::vector Ranges; +}; + +struct NormalizedSelectionTemporary final { + std::uint32_t ID = 0; + std::uint32_t TypeFromOperand = 0; +}; + +enum class NormalizedSelectionImmediateTransform : std::uint8_t { + Identity, + Negate, + PlusOne, }; struct NormalizedSelectionOperandRenderer final { enum class Kind : std::uint8_t { Operand, PhysicalRegister, + Temporary, + CapturedImmediate, + Immediate, }; Kind SourceKind = Kind::Operand; std::uint32_t Value = 0; std::uint16_t Flags = 0; + NormalizedSelectionImmediateTransform Transform = + NormalizedSelectionImmediateTransform::Identity; + std::int64_t Immediate = 0; +}; + +struct NormalizedSelectionAction final { + std::uint32_t ResultOpcode = 0; + bool ReplacesRoot = false; + std::vector OperandRenderers; }; struct NormalizedSelectionRule final { @@ -221,9 +249,8 @@ struct NormalizedSelectionRule final { std::vector OperandBanks; std::vector OperandClasses; std::vector OperandDefConstants; - std::uint32_t ResultOpcode = 0; - std::optional> OperandRenderers; - std::vector AppendedImmediates; + std::vector Temporaries; + std::vector Actions; std::vector EraseOperandDefinitions; }; -- cgit v1.2.3