diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-09-20 00:27:22 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-20 00:27:22 +0000 |
| commit | e97f7947b154bb804befc663cc0038f1e581a905 (patch) | |
| tree | 9888094fcefe2080b27d5765579d8172f1ca045a /llvm | |
| parent | 06694d0a2f487c5fc59dd8e2d76366d97598abfb (diff) | |
| download | bcm5719-llvm-e97f7947b154bb804befc663cc0038f1e581a905.tar.gz bcm5719-llvm-e97f7947b154bb804befc663cc0038f1e581a905.zip | |
[x86] fix variable names; NFC
llvm-svn: 281953
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 990d0ea0b67..721956861f3 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -14635,22 +14635,22 @@ static SDValue LowerFABSorFNEG(SDValue Op, SelectionDAG &DAG) { static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { const TargetLowering &TLI = DAG.getTargetLoweringInfo(); LLVMContext *Context = DAG.getContext(); - SDValue Op0 = Op.getOperand(0); - SDValue Op1 = Op.getOperand(1); + SDValue Mag = Op.getOperand(0); + SDValue Sign = Op.getOperand(1); SDLoc dl(Op); MVT VT = Op.getSimpleValueType(); - MVT SrcVT = Op1.getSimpleValueType(); + MVT SignVT = Sign.getSimpleValueType(); bool IsF128 = (VT == MVT::f128); - // If second operand is smaller, extend it first. - if (SrcVT.bitsLT(VT)) { - Op1 = DAG.getNode(ISD::FP_EXTEND, dl, VT, Op1); - SrcVT = VT; + // If the sign operand is smaller, extend it first. + if (SignVT.bitsLT(VT)) { + Sign = DAG.getNode(ISD::FP_EXTEND, dl, VT, Sign); + SignVT = VT; } // And if it is bigger, shrink it first. - if (SrcVT.bitsGT(VT)) { - Op1 = DAG.getNode(ISD::FP_ROUND, dl, VT, Op1, DAG.getIntPtrConstant(1, dl)); - SrcVT = VT; + if (SignVT.bitsGT(VT)) { + Sign = DAG.getNode(ISD::FP_ROUND, dl, VT, Sign, DAG.getIntPtrConstant(1, dl)); + SignVT = VT; } // At this point the operands and the result should have the same @@ -14678,22 +14678,22 @@ static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { // scalar FP logic instructions in SSE. This allows load folding of the // constants into the logic instructions. MVT LogicVT = (VT == MVT::f64) ? MVT::v2f64 : (IsF128 ? MVT::f128 : MVT::v4f32); - SDValue Mask1 = + SDValue SignMask = DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx, MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), /* Alignment = */ 16); if (!IsF128) - Op1 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Op1); - SDValue SignBit = DAG.getNode(X86ISD::FAND, dl, LogicVT, Op1, Mask1); + Sign = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Sign); + SDValue SignBit = DAG.getNode(X86ISD::FAND, dl, LogicVT, Sign, SignMask); // Next, clear the sign bit from the first operand (magnitude). // If it's a constant, we can clear it here. - if (ConstantFPSDNode *Op0CN = dyn_cast<ConstantFPSDNode>(Op0)) { + if (ConstantFPSDNode *Op0CN = dyn_cast<ConstantFPSDNode>(Mag)) { APFloat APF = Op0CN->getValueAPF(); // If the magnitude is a positive zero, the sign bit alone is enough. if (APF.isPosZero()) return IsF128 ? SignBit : - DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SrcVT, SignBit, + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SignVT, SignBit, DAG.getIntPtrConstant(0, dl)); APF.clearSign(); CV[0] = ConstantFP::get(*Context, APF); @@ -14703,20 +14703,21 @@ static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { } C = ConstantVector::get(CV); CPIdx = DAG.getConstantPool(C, PtrVT, 16); - SDValue Val = + SDValue MagMask = DAG.getLoad(LogicVT, dl, DAG.getEntryNode(), CPIdx, MachinePointerInfo::getConstantPool(DAG.getMachineFunction()), /* Alignment = */ 16); // If the magnitude operand wasn't a constant, we need to AND out the sign. - if (!isa<ConstantFPSDNode>(Op0)) { + SDValue MagBits = MagMask; + if (!isa<ConstantFPSDNode>(Mag)) { if (!IsF128) - Op0 = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Op0); - Val = DAG.getNode(X86ISD::FAND, dl, LogicVT, Op0, Val); + Mag = DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, LogicVT, Mag); + MagBits = DAG.getNode(X86ISD::FAND, dl, LogicVT, Mag, MagMask); } // OR the magnitude value with the sign bit. - Val = DAG.getNode(X86ISD::FOR, dl, LogicVT, Val, SignBit); - return IsF128 ? Val : - DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SrcVT, Val, + SDValue Or = DAG.getNode(X86ISD::FOR, dl, LogicVT, MagBits, SignBit); + return IsF128 ? Or : + DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, SignVT, Or, DAG.getIntPtrConstant(0, dl)); } |

