Adds new pseudo instructions to make sure that the fcvt instructions
have all rounding mode (RM) and unsigned (XU) variants across
single-width, widening and narrowing conversions.
And likewise, extends the VL patterns to accompany them. We don't add
new VL nodes for the widening/narrowing conversions though, instead we
just add specific patterns for vfcvts on those wider/narrower types.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
11648 | This is growing really unwieldy as it needs to handle the matrix of {X_F,XU_F,F_X,F_XU} x {M1,M2,M4,M8,MF2,MF4} x {vfcvt, vfwcvt, vfncvt}. Could this tablegen'ed away in another patch? | |
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td | ||
5579–5582 | Added in the use here to match VFCVT | |
5610–5613 | Added in use to match VFCVT |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9592 | Is it better to use VT.getScalarSizeInBits() > SrcVT.getScalarSizeInBits() * 2 || VT.getScalarSizeInBits() * 2 < SrcVT.getScalarSizeInBits() ? |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9592 | But wouldn't that allow invalid conversions like f32 -> i8?. From what I understand fwcvt always widens to a sew of double the size, and fncvt half |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9592 |
The expression is to deny invalid expression. f32->i8 should be avoided for the expression 8 * 2 = 16 < 32. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9592 | Ah sorry, I misunderstood. Updated |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
11648 | Not through any existing tablegen mechanism. This is running on MachineIR after isel. We could apply some preprocessor macros to unroll the LMUL. | |
llvm/lib/Target/RISCV/RISCVISelLowering.h | ||
241 | Why changing the order? This puts in a different order than the list in RISCVTargetLowering::getTargetNodeName | |
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | ||
898 | I'd prefer we didn't rename things in this patch. It makes the diff bigger and makes the view in phabricator more confusing. If you want to rename, do it as a separate pre-patch. |
llvm/lib/Target/RISCV/RISCVISelLowering.h | ||
---|---|---|
241 | I was trying to order it to match the spec, since the unsigned instructions seem to come before the signed instructions. Will take this out of this patch anyway |
llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | ||
---|---|---|
898 | Of course, left them out for now. The intention was to bring it in line with the pseudo and spec convention of suffixing instructions that access wider register groups with w |
Why changing the order? This puts in a different order than the list in RISCVTargetLowering::getTargetNodeName