[Bug target/82680] Use cmpXXss and cmpXXsd for setcc boolean compare

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 18 21:10:38 GMT 2021


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-08-18
     Ever confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
MSVC (in 64bit 19.30.30423.0) does:
        vucomisd xmm0, xmm1
        jp      SHORT $LN3@g
        jne     SHORT $LN3@g
        mov     eax, 1
        ret     0
$LN3@g:
        xor     eax, eax
        ret     0

MSVC (32bit, 19.30.30423.0) does:
        vmovsd  xmm0, QWORD PTR _x$[esp-4]
        vucomisd xmm0, QWORD PTR _y$[esp-4]
        mov     edx, 1
        lahf
        xor     ecx, ecx
        test    ah, 68                              ; 00000044H
        cmovnp  ecx, edx
        mov     eax, ecx
; Line 5
        ret     0

I don't know why there is a difference as both are the same version.

Confirmed.


More information about the Gcc-bugs mailing list