https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116574

--- Comment #5 from Bernardo Sulzbach <bernardo at bernardosulzbach dot com> ---
(In reply to Andrew Pinski from comment #1)
> -fno-trapping-math removes the zeroing of the top half of the registers.

I see. I tried passing that and got

    add(std::array<float, 2ul>, std::array<float, 2ul>):
        movaps  xmm2, xmm1
        movaps  xmm1, xmm0
        addps   xmm1, xmm2
        movdqa  xmm0, xmm1
        ret

with -Os and

    add(std::array<float, 2ul>, std::array<float, 2ul>):
        addps   xmm1, xmm0
        movdqa  xmm0, xmm1
        ret

with -O2/-O3. Is there a reason for `addps xmm1, xmm0` and moving instead of
`addps xmm0, xmm1`?

Reply via email to