Skip to content

Commit 2fea1cc

Browse files
committed
[RISCV][GISel] Correct the widening predicate for G_SITOFP/G_UITOFP.
This happened to coincidentally work due to D and Zfh both depending on the F extension. It breaks when I tried to add fp128 libcall support.
1 parent a2fc276 commit 2fea1cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
570570
[=, &ST](const LegalityQuery &Query) {
571571
return Query.Types[0].isScalar() && Query.Types[1].isScalar() &&
572572
(Query.Types[1].getSizeInBits() < ST.getXLen()) &&
573-
((ST.hasStdExtF() && Query.Types[1].getSizeInBits() == 32) ||
574-
(ST.hasStdExtD() && Query.Types[1].getSizeInBits() == 64) ||
573+
((ST.hasStdExtF() && Query.Types[0].getSizeInBits() == 32) ||
574+
(ST.hasStdExtD() && Query.Types[0].getSizeInBits() == 64) ||
575575
(ST.hasStdExtZfh() &&
576-
Query.Types[1].getSizeInBits() == 16));
576+
Query.Types[0].getSizeInBits() == 16));
577577
},
578578
LegalizeMutations::changeTo(1, sXLen))
579579
// Otherwise only promote to s32 since we have si libcalls.

0 commit comments

Comments
 (0)