summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-05 07:22:39 +0000
committerChris Lattner <sabre@nondot.org>2008-03-05 07:22:39 +0000
commit2acd0c25f6f26e3c97102a2b602af3791b89b7ae (patch)
treea8638d0ff15dc85bcbcdc68eae80fd710db53b7f /llvm/lib/Target
parent78e9cab2298c01a02dedfea85c4ec5aad4024a24 (diff)
downloadbcm5719-llvm-2acd0c25f6f26e3c97102a2b602af3791b89b7ae.tar.gz
bcm5719-llvm-2acd0c25f6f26e3c97102a2b602af3791b89b7ae.zip
add a note
llvm-svn: 47939
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/README-SSE.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README-SSE.txt b/llvm/lib/Target/X86/README-SSE.txt
index acfe411623c..7248a57df32 100644
--- a/llvm/lib/Target/X86/README-SSE.txt
+++ b/llvm/lib/Target/X86/README-SSE.txt
@@ -748,3 +748,33 @@ Note: this is not a code quality issue; the custom lowered code happens to be
right, but we shouldn't have to custom lower anything. This is probably related
to <2 x i64> ops being so bad.
+//===---------------------------------------------------------------------===//
+
+'select' on vectors and scalars could be a whole lot better. We currently
+lower them to conditional branches. On x86-64 for example, we compile this:
+
+double test(double a, double b, double c, double d) { return a<b ? c : d; }
+
+to:
+
+_test:
+ ucomisd %xmm0, %xmm1
+ ja LBB1_2 # entry
+LBB1_1: # entry
+ movapd %xmm3, %xmm2
+LBB1_2: # entry
+ movapd %xmm2, %xmm0
+ ret
+
+instead of:
+
+_test:
+ cmpltsd %xmm1, %xmm0
+ andpd %xmm0, %xmm2
+ andnpd %xmm3, %xmm0
+ orpd %xmm2, %xmm0
+ ret
+
+For unpredictable branches, the later is much more efficient. This should
+just be a matter of having scalar sse map to SELECT_CC and custom expanding
+or iseling it.
OpenPOWER on IntegriCloud