Bug 23077 – codegen cannot generage XMM load/store for optimized operation that uses byte/short/...

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2022-05-02T02:41:17Z
Last change time
2022-05-06T21:11:19Z
Keywords
backend, pull, SIMD
Assigned to
No Owner
Creator
Luís Ferreira
See also
https://issues.dlang.org/show_bug.cgi?id=23084, https://issues.dlang.org/show_bug.cgi?id=23085

Comments

Comment #0 by contact — 2022-05-02T02:41:17Z
The following code produces an Illegal instruction (core dumped) on the compiler: float bug(float x) { short i = *cast(short*)&x; ++i; return *cast(float*)&i; } The codegen try to generate optimized calls with XMM opcodes but fail to do it. This might happen to other types too.
Comment #1 by contact — 2022-05-02T02:44:09Z
Blocking `intel-intrinsics` buildkite job.
Comment #2 by dlang-bot — 2022-05-02T03:12:03Z
@ljmf00 updated dlang/dmd pull request #14058 "fix(backend): define XMM load/store codegen for short type variants" fixing this issue: - fix(backend): define XMM load/store codegen for short type variants The codegen try to generate optimized calls with XMM opcodes but fail to do it. This patch adds logic to generate XMM load/store opcodes for TYshort,TYushort,TYchar,TYwchar,TYdchar. It also adds tests for previous similar ICEs. Fix issue 23077. Reference: https://issues.dlang.org/show_bug.cgi?id=23077 Reference: https://github.com/AuburnSounds/intel-intrinsics/commit/047e9f01ae4092600f99abab1a34e32db26b3a4f Signed-off-by: Luís Ferreira <[email protected]> https://github.com/dlang/dmd/pull/14058
Comment #3 by ibuclaw — 2022-05-03T21:32:19Z
*** This issue has been marked as a duplicate of issue 23084 ***
Comment #4 by dlang-bot — 2022-05-06T00:57:41Z
@WalterBright created dlang/dmd pull request #14081 "fix Issue 23077 - codegen cannot generage XMM load/store for optimize…" fixing this issue: - fix Issue 23077 - codegen cannot generage XMM load/store for optimized operation that uses byte/short https://github.com/dlang/dmd/pull/14081
Comment #5 by bugzilla — 2022-05-06T03:26:25Z
*** Issue 23084 has been marked as a duplicate of this issue. ***
Comment #6 by dlang-bot — 2022-05-06T21:10:30Z
dlang/dmd pull request #14081 "fix Issue 23077 - codegen cannot generage XMM load/store for optimize…" was merged into stable: - 843c0d5cb44812121c227376e0948c5fa97606bd by Walter Bright: fix Issue 23077 - codegen cannot generage XMM load/store for optimized operation that uses byte/short https://github.com/dlang/dmd/pull/14081
Comment #7 by ibuclaw — 2022-05-06T21:11:19Z
*** Issue 23085 has been marked as a duplicate of this issue. ***