[SystemZ] Fix argument type of tdc instruction.
authorKai Nacke <kai.nacke@de.ibm.com>
Mon, 9 May 2022 13:53:28 +0000 (09:53 -0400)
committerKai Nacke <kai.nacke@de.ibm.com>
Mon, 9 May 2022 17:12:37 +0000 (13:12 -0400)
The DAG node for the Test Data Class is defined using i64 as the second parameter.
However, the code to lower is_fpclass uses `i32` as type. This only works because no
type check is generated in the DAG matcher.
This PR changes the type of the mask constant to `i64`.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D125230

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

index db62946..364b634 100644 (file)
@@ -5647,7 +5647,7 @@ SDValue SystemZTargetLowering::lowerIS_FPCLASS(SDValue Op,
     TDCMask |= SystemZ::TDCMASK_ZERO_PLUS;
   if (Check & fcNegZero)
     TDCMask |= SystemZ::TDCMASK_ZERO_MINUS;
-  SDValue TDCMaskV = DAG.getConstant(TDCMask, DL, MVT::i32);
+  SDValue TDCMaskV = DAG.getConstant(TDCMask, DL, MVT::i64);
 
   SDValue Intr = DAG.getNode(SystemZISD::TDC, DL, ResultVT, Arg, TDCMaskV);
   return getCCResult(DAG, Intr);