[Issue 23009] [CODEGEN][SIMD] SIMD + optimizations + inlining + double

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 11 10:12:15 UTC 2022


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel at live.nl

--- Comment #1 from Dennis <dkorpel at live.nl> ---
Reduced a bit more:
```
import core.simd;
import core.stdc.stdio;

double2 _mm_loadl_pd(double2 a, const(double)* mem_addr)
{
    a[0] = *mem_addr;
    return a;
}

void main()
{
    double A = 7.0;
    double2 B;
    B[0] = 4.0;
    B[1] = -5.0;
    double2 R = _mm_loadl_pd(B, &A);
    printf("%f %f\n", R[0], R[1]);
    double[2] correct = [ 7.0, -5.0 ];
    assert(R.array == correct);
}
```
Compile with -O, this one actually succeeds when _mm_loadl_pd gets inlined
either with -inline or manually.

Prints:
7.000000 0.000000
Instead of:
7.000000 -5.000000

--


More information about the Digitalmars-d-bugs mailing list