This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/53759] gcc -mavx emits vshufps for__builtin_ia32_loadlps
- From: "dag at nimrod dot no" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Jun 2012 12:45:55 +0000
- Subject: [Bug target/53759] gcc -mavx emits vshufps for__builtin_ia32_loadlps
- Auto-submitted: auto-generated
- References: <bug-53759-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53759
--- Comment #1 from Dag Lem <dag at nimrod dot no> 2012-06-24 12:45:55 UTC ---
Test code as follows:
------------------------
typedef float v4sf __attribute__ ((vector_size (4*4)));
typedef float v2sf __attribute__ ((vector_size (4*2)));
v2sf mem[1];
int main()
{
v4sf reg = (v4sf){0,0,0,0};
reg = __builtin_ia32_loadlps(reg, mem);
return reg[0];
}
------------------------
With -msse, gcc emits the following code:
xorps %xmm0, %xmm0
movlps mem, %xmm0
However with -mavx, gcc emits:
vxorps %xmm0, %xmm0, %xmm0
vmovlps mem, %xmm1, %xmm1
vshufps $0xe4, %xmm0, %xmm1, %xmm0
Shouldn't this rather have been something like
vxorps %xmm0, %xmm0, %xmm0
vmovlps mem, %xmm0, %xmm0
???