diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 20:03:59 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-15 20:03:59 +0800 |
| commit | 5b6ba4568cf6916a61ecde702f45246db8154b9f (patch) | |
| tree | e581672bd1f27bf68831ea5222d92a8e8337fcfe /backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | |
| parent | b5fb607fa3f54e791baf7ab39faf77d925dd53b7 (diff) | |
| download | rcc-project-5b6ba4568cf6916a61ecde702f45246db8154b9f.tar.gz rcc-project-5b6ba4568cf6916a61ecde702f45246db8154b9f.tar.xz | |
[RISCV][GlobalISel] Legalize floating-point remainder
Diffstat (limited to 'backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp')
| -rw-r--r-- | backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp index ee7f856..bdc783b 100644 --- a/backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp +++ b/backend/lib/CodeGen/GlobalISel/LegalizerInfo.cpp @@ -256,6 +256,16 @@ LegalizeRuleSet &LegalizeRuleSet::widenScalarToNextPow2(std::size_t TypeIndex, }); } +LegalizeRuleSet &LegalizeRuleSet::scalarize(std::size_t TypeIndex) { + return fewerElementsIf( + [TypeIndex](const LegalizationQuery &Query) { + return TypeIndex < Query.Types.size() && Query.Types[TypeIndex].isVector(); + }, + [TypeIndex](const LegalizationQuery &Query) { + return std::pair{TypeIndex, *Query.Types[TypeIndex].scalarElementType()}; + }); +} + LegalizeRuleSet &LegalizeRuleSet::minScalar(std::size_t TypeIndex, LowLevelType MinimumType) { return widenScalarIf( [TypeIndex, MinimumType](const LegalizationQuery &Query) { |
