Introduced by https://github.com/dlang/dmd/pull/7994
---
short saturateSignedIntToSignedShort(int value) {
return cast(short) value;
}
__vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) {
__vector(short[8]) r;
r= saturateSignedIntToSignedShort(a.array[0]);
return cast(__vector(int[4]))r;
}
Comment #1 by ibuclaw — 2022-05-03T20:00:33Z
Reverting PR7994, and the ICE moves to a different location, which points at another regression in v2.087.0 introduced by https://github.com/dlang/dmd/pull/9608
Comment #2 by ibuclaw — 2022-05-03T20:28:42Z
Reverting both PR7994 and PR9608 and there is still an ICE in stable.
Yet another regressing commit in v2.096.0 introduced by https://github.com/dlang/dmd/pull/12048
Comment #3 by ibuclaw — 2022-05-03T20:51:08Z
Reverting PR7994, PR9608, and PR12048 and there is still an ICE in stable.
Yet another regressing commit in v2.097.0 introduced by https://github.com/dlang/dmd/pull/12409
Comment #4 by ibuclaw — 2022-05-03T21:23:05Z
Reverting PR7994, PR9608, PR12048, and PR12409, and the ICE goes away in both upstream stable (081d61e15) and master (7b07f9164) branches.
Combining different combinations of reverting the above PRs against the reduced test results in the ICE.
---
tym = 0x6
dmd: src/dmd/backend/cgxmm.d:816: Assertion `0' failed.
Aborted (core dumped)
---
Reverting PR7994, PR9608, and PR12409 only results in the ICE:
---
tym = x6
dmd: src/dmd/backend/cgxmm.d:765: Assertion `0' failed.
Aborted (core dumped)
---
Comment #5 by ibuclaw — 2022-05-03T21:32:19Z
*** Issue 23077 has been marked as a duplicate of this issue. ***
Comment #6 by ibuclaw — 2022-05-03T21:33:59Z
Test case from issue23077 that doesn't use SIMD.
---
float bug(float x) {
short i = *cast(short*)&x;
++i;
return *cast(float*)&i;
}
Comment #7 by ibuclaw — 2022-05-03T21:37:31Z
Original test simplified:
---
__vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) {
__vector(short[8]) r = cast(short)(a.array[0]);
return cast(__vector(int[4]))r;
}
Comment #8 by ibuclaw — 2022-05-04T08:44:23Z
Similar, but using byte vector. Only triggers in debug builds.
---
__vector(int[4]) _mm_packs_epi32 (__vector(int[4]) a) {
__vector(byte[16]) r = cast(byte)(a.array[0]);
return cast(__vector(int[4]))r;
}