summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-27 17:21:09 +0000
committerChris Lattner <sabre@nondot.org>2007-02-27 17:21:09 +0000
commit2ebb2e99d1fbe6c02b9367594ad8bee7eec86262 (patch)
tree25ae2c7946b01f25a647f1eb9366716beb93c511 /llvm/lib
parent28349abeab96ef0153a64cfdcbd2738a9b5026a7 (diff)
downloadbcm5719-llvm-2ebb2e99d1fbe6c02b9367594ad8bee7eec86262.tar.gz
bcm5719-llvm-2ebb2e99d1fbe6c02b9367594ad8bee7eec86262.zip
a note
llvm-svn: 34670
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/README-SSE.txt42
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README-SSE.txt b/llvm/lib/Target/X86/README-SSE.txt
index bab5373d652..2b7f9ae4392 100644
--- a/llvm/lib/Target/X86/README-SSE.txt
+++ b/llvm/lib/Target/X86/README-SSE.txt
@@ -530,3 +530,45 @@ to loads from constant pool.
Floating point max / min are commutable when -enable-unsafe-fp-path is
specified. We should turn int_x86_sse_max_ss and X86ISD::FMIN etc. into other
nodes which are selected to max / min instructions that are marked commutable.
+
+//===---------------------------------------------------------------------===//
+
+We should compile this:
+#include <xmmintrin.h>
+typedef union {
+ int i[4];
+ float f[4];
+ __m128 v;
+} vector4_t;
+void swizzle (const void *a, vector4_t * b, vector4_t * c) {
+ b->v = _mm_loadl_pi (b->v, (__m64 *) a);
+ c->v = _mm_loadl_pi (c->v, ((__m64 *) a) + 1);
+}
+
+to:
+
+_swizzle:
+ movl 4(%esp), %eax
+ movl 8(%esp), %edx
+ movl 12(%esp), %ecx
+ movlps (%eax), %xmm0
+ movlps %xmm0, (%edx)
+ movlps 8(%eax), %xmm0
+ movlps %xmm0, (%ecx)
+ ret
+
+not:
+
+swizzle:
+ movl 8(%esp), %eax
+ movaps (%eax), %xmm0
+ movl 4(%esp), %ecx
+ movlps (%ecx), %xmm0
+ movaps %xmm0, (%eax)
+ movl 12(%esp), %eax
+ movaps (%eax), %xmm0
+ movlps 8(%ecx), %xmm0
+ movaps %xmm0, (%eax)
+ ret
+
+
OpenPOWER on IntegriCloud