diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-03 22:53:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-03 22:53:57 +0000 |
commit | 3d45a853db014fdddcdb79424e663dfed5eccbc7 (patch) | |
tree | ef59efff710665fe5b607a310afd1f7e22bbaf07 /test/CodeGen | |
parent | 4f7228f851bc48fe6a729a9d526a0b8de60e48d0 (diff) | |
download | external_llvm-3d45a853db014fdddcdb79424e663dfed5eccbc7.zip external_llvm-3d45a853db014fdddcdb79424e663dfed5eccbc7.tar.gz external_llvm-3d45a853db014fdddcdb79424e663dfed5eccbc7.tar.bz2 |
LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r-- | test/CodeGen/X86/fast-isel-fneg.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fast-isel-fneg.ll b/test/CodeGen/X86/fast-isel-fneg.ll new file mode 100644 index 0000000..41b288b --- /dev/null +++ b/test/CodeGen/X86/fast-isel-fneg.ll @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | llc -fast-isel -march=x86-64 | FileCheck %s + +; CHECK: doo: +; CHECK: xorpd +define double @doo(double %x) nounwind { + %y = fsub double -0.0, %x + ret double %y +} + +; CHECK: foo: +; CHECK: xorps +define float @foo(float %x) nounwind { + %y = fsub float -0.0, %x + ret float %y +} |