[Bug target/60826] inefficient code for vector xor on SSE2

sunfish at mozilla dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 14 16:47:00 GMT 2014


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));
}



More information about the Gcc-bugs mailing list