add a note
authorChris Lattner <sabre@nondot.org>
Tue, 13 May 2008 18:48:54 +0000 (18:48 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 May 2008 18:48:54 +0000 (18:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51060 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README-SSE.txt

index 5c681e06e0c6643f1e2c15f928a11c267e032f31..5f114a855f097bada2a82ba6f8f823128244306f 100644 (file)
@@ -764,4 +764,28 @@ madd:
 
 //===---------------------------------------------------------------------===//
 
+Consider:
+#include <emmintrin.h> 
+__m128 foo2 (float x) {
+ return _mm_set_ps (0, 0, x, 0);
+}
+
+In x86-32 mode, we generate this spiffy code:
+
+_foo2:
+       movss   4(%esp), %xmm0
+       pshufd  $81, %xmm0, %xmm0
+       ret
+
+in x86-64 mode, we generate this code, which could be better:
+
+_foo2:
+       xorps   %xmm1, %xmm1
+       movss   %xmm0, %xmm1
+       pshufd  $81, %xmm1, %xmm0
+       ret
+
+In sse4 mode, we could use insertps to make both better.
+
+//===---------------------------------------------------------------------===//