diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-12 06:31:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-12 06:31:38 +0000 |
commit | ca23e17adfabc79629194c3d55ac1fca6dd73ba1 (patch) | |
tree | 8b01907523ba54fcb4eb7e8e7954c9ca666d434a | |
parent | 1cb960a4bb97336be1339fd5bc2eb28f125f099a (diff) |
another missed SSE optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39772 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/README-SSE.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Target/X86/README-SSE.txt b/lib/Target/X86/README-SSE.txt index 20e6a53267..f4b54c4dbb 100644 --- a/lib/Target/X86/README-SSE.txt +++ b/lib/Target/X86/README-SSE.txt @@ -598,3 +598,32 @@ entry: } //===---------------------------------------------------------------------===// + +These functions should produce the same code: + +#include <emmintrin.h> + +typedef long long __m128i __attribute__ ((__vector_size__ (16))); + +int foo(__m128i* val) { + return __builtin_ia32_vec_ext_v4si(*val, 1); +} +int bar(__m128i* val) { + union vs { + __m128i *_v; + int* _s; + } v = {val}; + return v._s[1]; +} + +We currently produce (with -m64): + +_foo: + pshufd $1, (%rdi), %xmm0 + movd %xmm0, %eax + ret +_bar: + movl 4(%rdi), %eax + ret + +//===---------------------------------------------------------------------===// |