This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/60826] inefficient code for vector xor on SSE2
- From: "sunfish at mozilla dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 14 Apr 2014 16:47:15 +0000
- Subject: [Bug target/60826] inefficient code for vector xor on SSE2
- Auto-submitted: auto-generated
- References: <bug-60826-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60826
--- Comment #2 from Dan Gohman <sunfish at mozilla dot com> ---
A little more detail: I think I have seen GCC use a spill + movsd reload as a
method of zeroing the non-zero-index vector elements of an xmm register,
however that's either not what's happening here, or it may be happening when it
isn't needed.
I think the x86-64 ABI doesn't require the unused parts of an xmm return
register to be zeroed, but even if it does, I can also reproduce the
unnecessary spill and reload when I modify the test function above to this:
void test(v2f64 w, v2f64 x, v2f64 z, double *p)
{
v2f64 y = f_and(w, x);
*p = vector_to_scalar(f_xor(z, y));
}