aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-29 09:14:47 +0000
committerChris Lattner <sabre@nondot.org>2006-01-29 09:14:47 +0000
commit6a28456e18c52cc37092d9358f9b84b59af1e794 (patch)
tree3e0c9166e3a925557696d6981842d76720001d60
parentb638cd89dbe0f4a0a7ae51699efcb862f17355e8 (diff)
add a high-priority SSE issue from sgefa
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25787 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/X86/README.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt
index 0074eb4336..2fdd352ffd 100644
--- a/lib/Target/X86/README.txt
+++ b/lib/Target/X86/README.txt
@@ -213,4 +213,38 @@ commutative, it is not matched with the load on both sides. The dag combiner
should be made smart enough to cannonicalize the load into the RHS of a compare
when it can invert the result of the compare for free.
+//===---------------------------------------------------------------------===//
+
+The code generated for 'abs' is truly aweful:
+
+float %foo(float %tmp.38) {
+ %tmp.39 = setgt float %tmp.38, 0.000000e+00
+ %tmp.45 = sub float -0.000000e+00, %tmp.38
+ %mem_tmp.0.0 = select bool %tmp.39, float %tmp.38, float %tmp.45
+ ret float %mem_tmp.0.0
+}
+
+_foo:
+ subl $4, %esp
+ movss LCPI1_0, %xmm0
+ movss 8(%esp), %xmm1
+ subss %xmm1, %xmm0
+ xorps %xmm2, %xmm2
+ ucomiss %xmm2, %xmm1
+ setp %al
+ seta %cl
+ orb %cl, %al
+ testb %al, %al
+ jne LBB_foo_2 #
+LBB_foo_1: #
+ movss %xmm0, %xmm1
+LBB_foo_2: #
+ movss %xmm1, (%esp)
+ flds (%esp)
+ addl $4, %esp
+ ret
+
+This should be a high-priority to fix. With the fp-stack, this is a single
+instruction. With SSE it could be far better than this. Why is the sequence
+above using 'setp'? It shouldn't care about nan's.