www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21816] New: testing XMM for nan does not work


          Issue ID: 21816
           Summary: testing XMM for nan does not work
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following fails the assert:

 bool testf(float t) {
    return cast(bool)t;

 void test3918() {

 int main() {
    return 0;

when compiling with -O for XMM. The generated code is:

                xorps   XMM1,XMM1
                ucomiss XMM1,XMM0
                jne     LC
(*)             jp      LC
                xor     EAX,EAX
                jmp short       L11
    LC:         mov     EAX,1
    L11:        ret

The (*) instruction is missing.

Apr 10 2021