This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add codegen for vp.fptosi.
AbandonedPublic

Authored by jacquesguan on Feb 27 2022, 7:25 PM.

Details

Summary

Add codegen for vp.fptosi.

Diff Detail

Event Timeline

jacquesguan created this revision.Feb 27 2022, 7:25 PM
jacquesguan requested review of this revision.Feb 27 2022, 7:25 PM
craig.topper requested changes to this revision.Feb 28 2022, 11:31 AM
craig.topper added inline comments.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3696

This doesn't work if the int and FP types don't have the same element size. FP_TO_SINT_VL does not guarantee this. See the lowering for ISD::FP_TO_SINT which has to handle widening, narrowing, and multi instruction cases.

This revision now requires changes to proceed.Feb 28 2022, 11:31 AM

Support narrowing and widening convert and add test case for it.

Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2022, 11:32 PM
jacquesguan added inline comments.Mar 3 2022, 11:32 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
3696

Done, thanks!

craig.topper added inline comments.Mar 7 2022, 10:16 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
6103

Shouldn't this be a node that uses VL and mask?

There is also an implementation here https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/raw/EPI/llvm/lib/Target/RISCV/RISCVISelLowering.cpp look for lowerVPFPIntConvOp. This is what myself, Fraser, or Roger had been planning to use for upstream. We just hadn't go there yet because we were waiting for fptoui and uitofp to be added.

I'm working on a new version of this.

jacquesguan abandoned this revision.Mar 30 2022, 4:25 AM