aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/README-SSE.txt
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-05-23 17:28:11 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-05-23 17:28:11 +0000
commitd4083d01d275de9d30b0e23a03d8bd1984c8ddab (patch)
tree3f1ca43a0b4476c520380893324668a66b4f684c /lib/Target/X86/README-SSE.txt
parent679860e31bd7b8f043ba1ccdc5990cb9bafd9055 (diff)
New entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/README-SSE.txt')
-rw-r--r--lib/Target/X86/README-SSE.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Target/X86/README-SSE.txt b/lib/Target/X86/README-SSE.txt
index f200cbf11a..7269fa2964 100644
--- a/lib/Target/X86/README-SSE.txt
+++ b/lib/Target/X86/README-SSE.txt
@@ -845,3 +845,47 @@ _f:
movaps %xmm1, %xmm0
punpckldq %xmm2, %xmm0
ret
+
+//===---------------------------------------------------------------------===//
+
+We compile this:
+
+__m128i
+foo2 (char x)
+{
+ return _mm_set_epi8 (1, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 1, 0, 0, 0, 0);
+}
+
+into:
+ movl $1, %eax
+ xorps %xmm0, %xmm0
+ pinsrw $2, %eax, %xmm0
+ movzbl 4(%esp), %eax
+ pinsrw $3, %eax, %xmm0
+ movl $256, %eax
+ pinsrw $7, %eax, %xmm0
+ ret
+
+
+gcc-4.2:
+ subl $12, %esp
+ movzbl 16(%esp), %eax
+ movdqa LC0, %xmm0
+ pinsrw $3, %eax, %xmm0
+ addl $12, %esp
+ ret
+ .const
+ .align 4
+LC0:
+ .word 0
+ .word 0
+ .word 1
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 256
+
+With SSE4, it should be
+ movdqa .LC0(%rip), %xmm0
+ pinsrb $6, %edi, %xmm0