diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-09-19 22:07:27 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-19 22:07:27 +0000 |
commit | 0fa3365923fdb342df4e6b285b598d1936ebf515 (patch) | |
tree | d170ace682d0be0c8cf689fc1a5a05f6915996f1 /llvm/lib/Target | |
parent | 1355f4735d3c24e665c9a83c15970f929ee165a1 (diff) | |
download | bcm5719-llvm-0fa3365923fdb342df4e6b285b598d1936ebf515.tar.gz bcm5719-llvm-0fa3365923fdb342df4e6b285b598d1936ebf515.zip |
[x86] use getSignBit() to simplify code; NFCI
llvm-svn: 281944
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index bf9770857e1..990d0ea0b67 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -14669,7 +14669,7 @@ static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { // First, clear all bits but the sign bit from the second operand (sign). CV[0] = ConstantFP::get(*Context, - APFloat(Sem, APInt::getHighBitsSet(SizeInBits, 1))); + APFloat(Sem, APInt::getSignBit(SizeInBits))); Constant *C = ConstantVector::get(CV); auto PtrVT = TLI.getPointerTy(DAG.getDataLayout()); SDValue CPIdx = DAG.getConstantPool(C, PtrVT, 16); @@ -14698,9 +14698,8 @@ static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) { APF.clearSign(); CV[0] = ConstantFP::get(*Context, APF); } else { - CV[0] = ConstantFP::get( - *Context, - APFloat(Sem, APInt::getLowBitsSet(SizeInBits, SizeInBits - 1))); + CV[0] = ConstantFP::get(*Context, + APFloat(Sem, ~APInt::getSignBit(SizeInBits))); } C = ConstantVector::get(CV); CPIdx = DAG.getConstantPool(C, PtrVT, 16); |