www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21527] New: Unnecessary store to memory in SIMD code

https://issues.dlang.org/show_bug.cgi?id=21527

          Issue ID: 21527
           Summary: Unnecessary store to memory in SIMD code
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

The following code:

 float f(float a, float b) {
    float c = a + b;
    float d = c - b;
    return d;
 }

unnecessarily stores c into memory when it could be left in an XMM register.
Compile with -m32 -O.

--
Jan 06