digitalmars.D.bugs - [Issue 23049] New: [SIMD][CODEGEN] Wrong code for XMM.RCPSS after
- d-bugmail puremagic.com (42/42) Apr 23 2022 https://issues.dlang.org/show_bug.cgi?id=23049
https://issues.dlang.org/show_bug.cgi?id=23049 Issue ID: 23049 Summary: [SIMD][CODEGEN] Wrong code for XMM.RCPSS after inlining Product: D Version: D2 Hardware: x86_64 OS: All Status: NEW Severity: major Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: aliloko gmail.com Created attachment 1849 --> https://issues.dlang.org/attachment.cgi?id=1849&action=edit main source With DMD 2.100-beta.1, Consider the following program: ------------ main.d ------------ import core.simd; import core.stdc.stdio; float4 _mm_rcp_ss (float4 a) pure trusted { return cast(float4) __simd(XMM.RCPSS, a); } void main() { float4 A = [2.34f, -70000.0f, 0.00001f, 345.5f]; float4 correct = [1 / 2.34f, -70000.0f, 0.00001f, 345.5f]; float4 R = _mm_rcp_ss(A); // sometimes DMD clears to zero the high values. assert(R.array[1] == correct.array[1]); assert(R.array[2] == correct.array[2]); assert(R.array[3] == correct.array[3]); } -------------------------------- The first assertion fails when built with: $ dmd -inline -m64 main.d RCPSS is used, but the top of the register/variable is cleared to zero when XMM.RCPSS is inline into the unittest. --
Apr 23 2022