summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-09-10 00:49:22 +0000
committerBob Wilson <bob.wilson@apple.com>2009-09-10 00:49:22 +0000
commit2a16e6b22c558f9ba0b25096dfe0697488e51c8e (patch)
treeff1c75a76ab98e6eb7893f00d805e4d41d2bae5e
parentd1a5b37a62e829e56b6225e0934a01d9f8823387 (diff)
downloadllvm-2a16e6b22c558f9ba0b25096dfe0697488e51c8e.tar.gz
llvm-2a16e6b22c558f9ba0b25096dfe0697488e51c8e.tar.bz2
llvm-2a16e6b22c558f9ba0b25096dfe0697488e51c8e.tar.xz
Revert r81171 which was causing pr4927.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81415 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp21
-rw-r--r--test/CodeGen/X86/fast-isel-fneg.ll6
2 files changed, 7 insertions, 20 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 8550ea9813..f0c7086184 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -615,25 +615,12 @@ FastISel::SelectFNeg(User *I) {
unsigned OpReg = getRegForValue(BinaryOperator::getFNegArgument(I));
if (OpReg == 0) return false;
- // Bitcast the value to integer, twiddle the sign bit with xor,
- // and then bitcast it back to floating-point.
+ // Twiddle the sign bit with xor.
EVT VT = TLI.getValueType(I->getType());
if (VT.getSizeInBits() > 64) return false;
- EVT IntVT = EVT::getIntegerVT(I->getContext(), VT.getSizeInBits());
-
- unsigned IntReg = FastEmit_r(VT.getSimpleVT(), IntVT.getSimpleVT(),
- ISD::BIT_CONVERT, OpReg);
- if (IntReg == 0)
- return false;
-
- unsigned IntResultReg = FastEmit_ri_(IntVT.getSimpleVT(), ISD::XOR, IntReg,
- UINT64_C(1) << (VT.getSizeInBits()-1),
- IntVT.getSimpleVT());
- if (IntResultReg == 0)
- return false;
-
- unsigned ResultReg = FastEmit_r(IntVT.getSimpleVT(), VT.getSimpleVT(),
- ISD::BIT_CONVERT, IntResultReg);
+ unsigned ResultReg = FastEmit_ri_(VT.getSimpleVT(), ISD::XOR, OpReg,
+ UINT64_C(1) << (VT.getSizeInBits()-1),
+ VT.getSimpleVT());
if (ResultReg == 0)
return false;
diff --git a/test/CodeGen/X86/fast-isel-fneg.ll b/test/CodeGen/X86/fast-isel-fneg.ll
index 70191bdfdf..15d4772927 100644
--- a/test/CodeGen/X86/fast-isel-fneg.ll
+++ b/test/CodeGen/X86/fast-isel-fneg.ll
@@ -1,14 +1,14 @@
-; RUN: llc < %s -fast-isel -fast-isel-abort -march=x86-64 | FileCheck %s
+; RUN: llc < %s -fast-isel -march=x86-64 | FileCheck %s
; CHECK: doo:
-; CHECK: xor
+; CHECK: xorpd
define double @doo(double %x) nounwind {
%y = fsub double -0.0, %x
ret double %y
}
; CHECK: foo:
-; CHECK: xor
+; CHECK: xorps
define float @foo(float %x) nounwind {
%y = fsub float -0.0, %x
ret float %y