[llvm] [NVPTX] Make i16x2 a native type and add supported vec instructions (PR #65432)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 15:00:00 PDT 2023


================
@@ -584,6 +617,22 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
     setOperationAction(ISD::CTLZ, Ty, Legal);
   }
 
+  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::AND, MVT::v2i16, Legal, Custom);
----------------
Artem-B wrote:

and/or/xor would also boil down to i32 logical ops and probably do not require new GPUs. 
It looks like ADD ended up here by mistake as none of the other logical ops made it to this list.

https://github.com/llvm/llvm-project/pull/65432


More information about the llvm-commits mailing list