[Bug target/69041] Unnecessary push/pop of caller-save register (ecx) on 32bit with vector intrinsics. Sometimes without the pop, clobbering ebp (callee-save)
peter at cordes dot ca
gcc-bugzilla@gcc.gnu.org
Fri Dec 25 06:34:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69041
Peter Cordes <peter at cordes dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|i386-linux-gnu |i386-linux-gnu,
| |x86_64-linux-gnu
--- Comment #1 from Peter Cordes <peter at cordes dot ca> ---
I noticed a similar (the same?) problem in 64bit mode: http://goo.gl/8B7O7T
typedef float __m512 __attribute__ ((vector_size (64)));
__m512 mul_broad(__m512 a, float b) {
asm(
//"vbroadcastss %[scalar], %g[scalar]\n\t"
//"vmulps %g[scalar], %[vec], %[vec]\n\t"
""
: [vec] "+x" (a), [scalar] "+x" (b)
:
:
);
return a;
}
mul_broad(float __vector(16), float):
push %rbp
mov %rsp,%rbp
push %r10
pop %r10
pop %rbp
retq
An extremely similar function compiles fine:
__m512 mul_broad2(__m512 a, float b) {
__m512 tmpvec;
asm(
"vbroadcastss %[scalar], %[tmpvec]\n\t"
"vmulps %[tmpvec], %[vec], %[vec]\n\t"
: [vec] "+x" (a), [tmpvec] "=x" (tmpvec)
: [scalar] "1" (b)
:
);
return a;
}
mul_broad2(float __vector(16), float):
vbroadcastss %xmm1,%zmm1
vmulps %zmm1,%zmm0,%zmm0
retq
More information about the Gcc-bugs
mailing list