aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/TableGen
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/lib/TableGen
parent2c7a437b066ad243a21af6d2c1ce1550e467f5f5 (diff)
downloadrcc-project-220c9cd426ec0590f6a43550b28fb344d8dfd8fd.tar.gz
rcc-project-220c9cd426ec0590f6a43550b28fb344d8dfd8fd.tar.xz
[RISCV][GlobalISel] Legalize floating-point to integer conversions
Diffstat (limited to 'backend/lib/TableGen')
-rw-r--r--backend/lib/TableGen/Parser.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/backend/lib/TableGen/Parser.cpp b/backend/lib/TableGen/Parser.cpp
index 66d10e0..2d7116d 100644
--- a/backend/lib/TableGen/Parser.cpp
+++ b/backend/lib/TableGen/Parser.cpp
@@ -864,7 +864,7 @@ private:
if (!checkKeys(Node,
{"kinds", "role", "register_class", "register_bank", "immediate_predicate",
"memory_role", "default_tied_operand", "early_clobber", "optional",
- "variadic_group", "allow_subreg", "name", "allowed_target_flags"},
+ "variadic_group", "allow_subreg", "name", "type_index", "allowed_target_flags"},
"instruction operand")) {
return std::nullopt;
}
@@ -944,6 +944,16 @@ private:
return std::nullopt;
Result.NameSymbol = *Value;
}
+ if (const yaml::Node *TypeIndex = optionalNode(Node, "type_index")) {
+ const auto Value = unsignedInteger32(*TypeIndex, "instruction operand type_index");
+ if (!Value)
+ return std::nullopt;
+ if (*Value > std::numeric_limits<std::uint16_t>::max()) {
+ fail(TypeIndex->range(), "instruction operand type_index is outside the uint16 range");
+ return std::nullopt;
+ }
+ Result.TypeIndex = static_cast<std::uint16_t>(*Value);
+ }
if (const yaml::Node *TargetFlags = optionalNode(Node, "allowed_target_flags")) {
const auto Value =
unsignedInteger32(*TargetFlags, "instruction operand allowed_target_flags");