@@ -937,8 +937,11 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
937
937
ExpandUINT_TO_FLOAT (Node, Results);
938
938
return ;
939
939
case ISD::FNEG:
940
- Results.push_back (ExpandFNEG (Node));
941
- return ;
940
+ if (SDValue Expanded = ExpandFNEG (Node)) {
941
+ Results.push_back (Expanded);
942
+ return ;
943
+ }
944
+ break ;
942
945
case ISD::FSUB:
943
946
ExpandFSUB (Node, Results);
944
947
return ;
@@ -1777,16 +1780,16 @@ SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
1777
1780
EVT IntVT = VT.changeVectorElementTypeToInteger ();
1778
1781
1779
1782
// FIXME: The FSUB check is here to force unrolling v1f64 vectors on AArch64.
1780
- if (TLI.isOperationLegalOrCustom (ISD::XOR, IntVT) &&
1781
- TLI.isOperationLegalOrCustom (ISD::FSUB, VT)) {
1782
- SDLoc DL (Node );
1783
- SDValue Cast = DAG. getNode (ISD::BITCAST, DL, IntVT, Node-> getOperand ( 0 ));
1784
- SDValue SignMask = DAG. getConstant (
1785
- APInt::getSignMask (IntVT. getScalarSizeInBits ()) , DL, IntVT);
1786
- SDValue Xor = DAG.getNode (ISD::XOR, DL, IntVT, Cast, SignMask);
1787
- return DAG. getNode (ISD::BITCAST , DL, VT, Xor );
1788
- }
1789
- return DAG.UnrollVectorOp (Node );
1783
+ if (! TLI.isOperationLegalOrCustom (ISD::XOR, IntVT) ||
1784
+ ! TLI.isOperationLegalOrCustom (ISD::FSUB, VT))
1785
+ return SDValue ( );
1786
+
1787
+ SDLoc DL (Node);
1788
+ SDValue Cast = DAG. getNode (ISD::BITCAST , DL, IntVT, Node-> getOperand ( 0 ) );
1789
+ SDValue SignMask = DAG.getConstant (
1790
+ APInt::getSignMask (IntVT. getScalarSizeInBits ()) , DL, IntVT );
1791
+ SDValue Xor = DAG. getNode (ISD::XOR, DL, IntVT, Cast, SignMask);
1792
+ return DAG.getNode (ISD::BITCAST, DL, VT, Xor );
1790
1793
}
1791
1794
1792
1795
void VectorLegalizer::ExpandFSUB (SDNode *Node,
0 commit comments