aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-29 08:37:08 +0000
committerChris Lattner <sabre@nondot.org>2007-12-29 08:37:08 +0000
commit63079f0757785c5c461bafdd3101ee40aeb717fe (patch)
tree37d7b2cfa774bb40277cbba69dda31a00ea2d3bd /test/CodeGen/X86
parent69bfbdfaeebf366b70a1aa3ba650685493da9e8c (diff)
downloadexternal_llvm-63079f0757785c5c461bafdd3101ee40aeb717fe.zip
external_llvm-63079f0757785c5c461bafdd3101ee40aeb717fe.tar.gz
external_llvm-63079f0757785c5c461bafdd3101ee40aeb717fe.tar.bz2
Fold comparisons against a constant nan, and optimize ORD/UNORD
comparisons with a constant. This allows us to compile isnan to: _foo: fcmpu cr7, f1, f1 mfcr r2 rlwinm r3, r2, 0, 31, 31 blr instead of: LCPI1_0: ; float .space 4 _foo: lis r2, ha16(LCPI1_0) lfs f0, lo16(LCPI1_0)(r2) fcmpu cr7, f1, f0 mfcr r2 rlwinm r3, r2, 0, 31, 31 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45405 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/isnan.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/X86/isnan.ll b/test/CodeGen/X86/isnan.ll
new file mode 100644
index 0000000..18fe29a
--- /dev/null
+++ b/test/CodeGen/X86/isnan.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah | not grep pxor
+
+; This should not need to materialize 0.0 to evaluate the condition.
+
+define i32 @test(double %X) nounwind {
+entry:
+ %tmp6 = fcmp uno double %X, 0.000000e+00 ; <i1> [#uses=1]
+ %tmp67 = zext i1 %tmp6 to i32 ; <i32> [#uses=1]
+ ret i32 %tmp67
+}
+