From 0fa3365923fdb342df4e6b285b598d1936ebf515 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 19 Sep 2016 22:07:27 +0000 Subject: [PATCH] [x86] use getSignBit() to simplify code; NFCI llvm-svn: 281944 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index bf97708..990d0ea 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); -- 2.7.4