The operation action for i32 and i64 cannot be set to legal, as long double needs custom lowering.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
1332 ↗ | (On Diff #33220) | I'm not sure, but I think you missed SINT_TO_FP case. |
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
1332 ↗ | (On Diff #33220) | Hi Asaf, The SINT_TO_FP case does not require as many changes as the UINT_TO_FP case. As the signed conversion instructions [v]cvtsi2ss/sd have existed since SSE/SSE2, LowerSINT_TO_FP already properly handles i32 and i64. And the operation action is properly set to Custom earlier in this function. But the unsigned conversion instructions vcvtusi2ss/sd are new as of avx512f, so support for i32/i64->FP needed to be added to LowerUINT_TO_FP, and their operation action needed to be changed to Custom above. regards, |
Thanks, Mitch!
A couple of comments inline.
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
167 ↗ | (On Diff #33220) | Any way to re-factor the if chain so we don't end up with two checks for useSoftFloat()? Or does that end up being uglier? |
1332 ↗ | (On Diff #33220) | I think what Asaf meant was that you removed setting SINT_TO_FP to Legal here, but didn't re-introduce it anywhere else. Does it get set to Legal elsewhere/by default? |
12258 ↗ | (On Diff #33220) | Do we only get here for f32/f64? If not, do you need to check the DstTy here is not f80? If yes, perhaps make the comment a bit clearer to emphasize that is the case? |
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
167 ↗ | (On Diff #33220) | I think it would be about a wash. But there's a separate issue there, where UINT_TO_FP MVT::i64 is currently set to custom under is64Bit, independent of soft float. Retaining that behavior would make using a single soft float check a bit uglier, so is not something I want to mess with in this change set. |
1332 ↗ | (On Diff #33220) | It already gets set to Custom earlier in the routine. For a conversion that has a mix of Legal and Custom lowerings BTW, for additional testing I wrote small functions exercising all integer and fp |
12258 ↗ | (On Diff #33220) | f80 can reach here, but is filtered by the isScalarFPTypeInSSEReg check. So it would be incomplete to single out just f80. I think the comment is |