@@ -467,8 +467,6 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
467467 addRegisterClass (MVT::v2bf16, &NVPTX::Int32RegsRegClass);
468468
469469 // Conversion to/from FP16/FP16x2 is always legal.
470- setOperationAction (ISD::SINT_TO_FP, MVT::f16 , Legal);
471- setOperationAction (ISD::FP_TO_SINT, MVT::f16 , Legal);
472470 setOperationAction (ISD::BUILD_VECTOR, MVT::v2f16, Custom);
473471 setOperationAction (ISD::EXTRACT_VECTOR_ELT, MVT::v2f16, Custom);
474472 setOperationAction (ISD::INSERT_VECTOR_ELT, MVT::v2f16, Expand);
@@ -478,8 +476,6 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
478476 setFP16OperationAction (ISD::SETCC, MVT::v2f16, Legal, Expand);
479477
480478 // Conversion to/from BFP16/BFP16x2 is always legal.
481- setOperationAction (ISD::SINT_TO_FP, MVT::bf16 , Legal);
482- setOperationAction (ISD::FP_TO_SINT, MVT::bf16 , Legal);
483479 setOperationAction (ISD::BUILD_VECTOR, MVT::v2bf16, Custom);
484480 setOperationAction (ISD::EXTRACT_VECTOR_ELT, MVT::v2bf16, Custom);
485481 setOperationAction (ISD::INSERT_VECTOR_ELT, MVT::v2bf16, Expand);
@@ -644,6 +640,13 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
644640 setI16x2OperationAction (ISD::SREM, MVT::v2i16, Legal, Custom);
645641 setI16x2OperationAction (ISD::UREM, MVT::v2i16, Legal, Custom);
646642
643+ // Other arithmetic and logic ops are unsupported.
644+ setOperationAction ({ISD::AND, ISD::OR, ISD::XOR, ISD::SDIV, ISD::UDIV,
645+ ISD::SRA, ISD::SRL, ISD::MULHS, ISD::MULHU,
646+ ISD::FP_TO_SINT, ISD::FP_TO_UINT, ISD::SINT_TO_FP,
647+ ISD::UINT_TO_FP},
648+ MVT::v2i16, Expand);
649+
647650 setOperationAction (ISD::ADDC, MVT::i32 , Legal);
648651 setOperationAction (ISD::ADDE, MVT::i32 , Legal);
649652 setOperationAction (ISD::SUBC, MVT::i32 , Legal);
0 commit comments