This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32661] New: __builtin_ia32_vec_ext suboptimal for pointer/ref args
- From: "scovich at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2007 23:27:35 -0000
- Subject: [Bug middle-end/32661] New: __builtin_ia32_vec_ext suboptimal for pointer/ref args
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling the following with "g++ -msse3 -O3":
#include <emmintrin.h>
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];
}
yields the following assembler output. Ideally, both functions would be the
same:
_Z3fooPU8__vectorx:
.LFB497:
pshufd $85, (%rdi), %xmm0
movd %xmm0, %rax
movq %xmm0, -8(%rsp)
ret
_Z3barPU8__vectorx:
.LFB498:
movl 4(%rdi), %eax
ret
--
Summary: __builtin_ia32_vec_ext suboptimal for pointer/ref args
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: scovich at gmail dot com
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32661