@@ -5484,29 +5484,29 @@ void DAGTypeLegalizer::ExpandIntRes_FunnelShift(SDNode *N, SDValue &Lo,
54845484void DAGTypeLegalizer::ExpandIntRes_CLMUL (SDNode *N, SDValue &Lo,
54855485 SDValue &Hi) {
54865486 // Values numbered from least significant to most significant.
5487- SDValue In1, In2, In3, In4 ;
5488- GetExpandedInteger (N->getOperand (0 ), In3, In4 );
5489- GetExpandedInteger (N->getOperand (1 ), In1, In2 );
5490- EVT HalfVT = In1 .getValueType ();
5487+ SDValue LL, LH, RL, RH ;
5488+ GetExpandedInteger (N->getOperand (0 ), LL, LH );
5489+ GetExpandedInteger (N->getOperand (1 ), RL, RH );
5490+ EVT HalfVT = LL .getValueType ();
54915491 SDLoc DL (N);
54925492
54935493 // CLMUL is carryless so Lo is computed from the low half
5494- Lo = DAG.getNode (ISD::CLMUL, DL, HalfVT, In1, In3 );
5494+ Lo = DAG.getNode (ISD::CLMUL, DL, HalfVT, LL, RL );
54955495 // the high bits not included in CLMUL(A,B) can be computed by
54965496 // BITREVERSE(CLMUL(BITREVERSE(A), BITREVERSE(B))) >> 1
54975497 // Therefore we can compute the 2 hi/lo cross products
54985498 // and the the overflow of the low product
54995499 // and xor them together to compute HI
5500- SDValue BitRevIn1 = DAG.getNode (ISD::BITREVERSE, DL, HalfVT, In1 );
5501- SDValue BitRevIn3 = DAG.getNode (ISD::BITREVERSE, DL, HalfVT, In3 );
5502- SDValue BitRevLoHi = DAG.getNode (ISD::CLMUL, DL, HalfVT, BitRevIn1, BitRevIn3 );
5500+ SDValue BitRevLL = DAG.getNode (ISD::BITREVERSE, DL, HalfVT, LL );
5501+ SDValue BitRevRL = DAG.getNode (ISD::BITREVERSE, DL, HalfVT, RL );
5502+ SDValue BitRevLoHi = DAG.getNode (ISD::CLMUL, DL, HalfVT, BitRevLL, BitRevRL );
55035503 SDValue LoHi = DAG.getNode (ISD::BITREVERSE, DL, HalfVT, BitRevLoHi);
5504- SDValue One = DAG.getConstant ( 0 , DL, HalfVT );
5504+ SDValue One = DAG.getShiftAmountConstant ( 1 , HalfVT, DL );
55055505 Hi = DAG.getNode (ISD::SRL, DL, HalfVT, LoHi, One);
55065506
5507- SDValue HITMP = DAG.getNode (ISD::CLMUL, DL, HalfVT, In1, In4 );
5507+ SDValue HITMP = DAG.getNode (ISD::CLMUL, DL, HalfVT, LL, RH );
55085508 Hi = DAG.getNode (ISD::XOR, DL, HalfVT, Hi, HITMP);
5509- HITMP = DAG.getNode (ISD::CLMUL, DL, HalfVT, In2, In3 );
5509+ HITMP = DAG.getNode (ISD::CLMUL, DL, HalfVT, LH, RL );
55105510 Hi = DAG.getNode (ISD::XOR, DL, HalfVT, Hi, HITMP);
55115511}
55125512
0 commit comments