Jump to conversation
Unresolved conversations (0)
Nice work!

Nice work!

All of your conversations have been resolved.

Resolved conversations (6)
@justinfargnoli justinfargnoli Jan 25, 2024
Hi @Artem-B, I believe that these patterns are not correct. Doing the comparison, without first ensuring that the value only uses the lower 8 bits, can lead to incorrect results. For example, when `%a := Ox100` and `%b := Ox1`, `setugt (i16 (and (trunc Int32Regs:$a), 255)), (i16 (and (trunc Int32Regs:$b), 255)))` produces a false predicate. Whereas `SETP_u32rr Int32Regs:$a, Int32Regs:$b, CmpHI` will produce a true predicate. (I'm not super familiar with the pattern syntax through, so please correct me if I'm misunderstanding something.)
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
@Artem-B Artem-B Oct 6, 2023
When we extract v4i8 values we must truncate them to 8 bits. They are carried in i16, so for negative values we end up with the unwanted extra 8 sign bits.
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@ThomasRaoux ThomasRaoux Oct 6, 2023
is it expected that the script checks for the hardcoded variable name?
llvm/test/CodeGen/NVPTX/i8x4-instructions.ll
Artem-B
@ThomasRaoux ThomasRaoux Oct 3, 2023
It looks like we are missing some actions for v4i8 types like from line 639 to line 658. ``` setI16x2OperationAction(ISD::ABS, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::SMIN, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::SMAX, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::UMIN, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::UMAX, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::CTPOP, MVT::v2i16, Legal, Expand); setI16x2OperationAction(ISD::CTLZ, MVT::v2i16, Legal, Expand); setI16x2OperationAction(ISD::ADD, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::SUB, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::MUL, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::SHL, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::SREM, MVT::v2i16, Legal, Custom); setI16x2OperationAction(ISD::UREM, MVT::v2i16, Legal, Custom); // Other arithmetic and logic ops are unsupported. setOperationAction({ISD::SDIV, ISD::UDIV, ISD::SRA, ISD::SRL, ISD::MULHS, ISD::MULHU, ISD::FP_TO_SINT, ISD::FP_TO_UINT, ISD::SINT_TO_FP, ISD::UINT_TO_FP}, MVT::v2i16, Expand); ```
llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@Artem-B Artem-B Oct 3, 2023
This still needs tests.
Outdated
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
@ThomasRaoux ThomasRaoux Oct 2, 2023
this generates ptx like this: ``` mov.b32 %r10, {%rs2, %rs1, %rs4, %rs3}; ``` which cause ptxas to emit this error: ``` error : Arguments mismatch for instruction 'mov' ```
Outdated
llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
Artem-B ThomasRaoux