aboutsummaryrefslogtreecommitdiff
path: root/backend/utils/TableGen/InstrInfoEmitter.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 19:04:08 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-15 19:04:08 +0800
commit220c9cd426ec0590f6a43550b28fb344d8dfd8fd (patch)
tree733b69782971fdd0a88e8f4581900a11a5dbdcbd /backend/utils/TableGen/InstrInfoEmitter.cpp
parent2c7a437b066ad243a21af6d2c1ce1550e467f5f5 (diff)
downloadrcc-project-220c9cd426ec0590f6a43550b28fb344d8dfd8fd.tar.gz
rcc-project-220c9cd426ec0590f6a43550b28fb344d8dfd8fd.tar.xz
[RISCV][GlobalISel] Legalize floating-point to integer conversions
Diffstat (limited to 'backend/utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r--backend/utils/TableGen/InstrInfoEmitter.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/backend/utils/TableGen/InstrInfoEmitter.cpp b/backend/utils/TableGen/InstrInfoEmitter.cpp
index b06134f..1f42d4a 100644
--- a/backend/utils/TableGen/InstrInfoEmitter.cpp
+++ b/backend/utils/TableGen/InstrInfoEmitter.cpp
@@ -49,7 +49,16 @@ void emitOperandDescriptor(std::ostream &Output, const NormalizedOperand &Operan
else
Output << "std::nullopt";
Output << ", .TargetOperandType = std::nullopt, .AllowedTargetFlags = "
- << Operand.AllowedTargetFlags << ", .TypeConstraint = std::nullopt},\n";
+ << Operand.AllowedTargetFlags << ", .TypeConstraint = ";
+ if (Operand.TypeIndex) {
+ Output << "OperandTypeConstraint{LowLevelTypeKindSet{"
+ << "LowLevelType::Kind::CategoryNeutralScalar, LowLevelType::Kind::Pointer, "
+ << "LowLevelType::Kind::Vector, LowLevelType::Kind::VectorPointer}, std::uint16_t{"
+ << *Operand.TypeIndex << "}}";
+ } else {
+ Output << "std::nullopt";
+ }
+ Output << "},\n";
}
void emitImplicitRegisterList(std::ostream &Output, const NormalizedTargetModel &Model,