[llvm] r281944 - [x86] use getSignBit() to simplify code; NFCI
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 15:07:27 PDT 2016
Author: spatel
Date: Mon Sep 19 17:07:27 2016
New Revision: 281944
URL: http://llvm.org/viewvc/llvm-project?rev=281944&view=rev
Log:
[x86] use getSignBit() to simplify code; NFCI
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=281944&r1=281943&r2=281944&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Sep 19 17:07:27 2016
@@ -14669,7 +14669,7 @@ static SDValue LowerFCOPYSIGN(SDValue Op
// 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
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);
More information about the llvm-commits
mailing list