[llvm-commits] [llvm] r51060 - /llvm/trunk/lib/Target/X86/README-SSE.txt
Chris Lattner
sabre at nondot.org
Tue May 13 11:48:54 PDT 2008
Author: lattner
Date: Tue May 13 13:48:54 2008
New Revision: 51060
URL: http://llvm.org/viewvc/llvm-project?rev=51060&view=rev
Log:
add a note
Modified:
llvm/trunk/lib/Target/X86/README-SSE.txt
Modified: llvm/trunk/lib/Target/X86/README-SSE.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README-SSE.txt?rev=51060&r1=51059&r2=51060&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README-SSE.txt (original)
+++ llvm/trunk/lib/Target/X86/README-SSE.txt Tue May 13 13:48:54 2008
@@ -764,4 +764,28 @@
//===---------------------------------------------------------------------===//
+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.
+
+//===---------------------------------------------------------------------===//
More information about the llvm-commits
mailing list