Skip to content

Commit

Permalink
[RISCV][GISel] Correct the widening predicate for G_SITOFP/G_UITOFP.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
topperc committed Dec 4, 2024
1 parent a2fc276 commit 2fea1cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
[=, &ST](const LegalityQuery &Query) {
return Query.Types[0].isScalar() && Query.Types[1].isScalar() &&
(Query.Types[1].getSizeInBits() < ST.getXLen()) &&
((ST.hasStdExtF() && Query.Types[1].getSizeInBits() == 32) ||
(ST.hasStdExtD() && Query.Types[1].getSizeInBits() == 64) ||
((ST.hasStdExtF() && Query.Types[0].getSizeInBits() == 32) ||
(ST.hasStdExtD() && Query.Types[0].getSizeInBits() == 64) ||
(ST.hasStdExtZfh() &&
Query.Types[1].getSizeInBits() == 16));
Query.Types[0].getSizeInBits() == 16));
},
LegalizeMutations::changeTo(1, sXLen))
// Otherwise only promote to s32 since we have si libcalls.
Expand Down

0 comments on commit 2fea1cc

Please sign in to comment.