D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21040 - SIMD: illegal instruction using 32-byte operations on AVX
Summary: SIMD: illegal instruction using 32-byte operations on AVX
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-07-11 23:05 UTC by Iain Buclaw
Modified: 2020-07-12 04:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2020-07-11 23:05:35 UTC
DMD compiles the following down to the same code for both -mcpu=avx and -mcpu=avx2.

---
long4 v;
v += 1;
---

However this throws an illegal instruction on machines that do not have AVX2 features.

The compiler should have isVectorOpSupported extended to be aware of which CPU feature implemented which vector operation.
Comment 1 Dlang Bot 2020-07-12 00:10:11 UTC
@ibuclaw created dlang/dmd pull request #11407 "fix Issue 21040 - SIMD: illegal instruction using 32-byte operations on AVX" fixing this issue:

- fix Issue 21040 - SIMD: illegal instruction using 32-byte operations on AVX

https://github.com/dlang/dmd/pull/11407
Comment 2 Dlang Bot 2020-07-12 04:21:24 UTC
dlang/dmd pull request #11407 "fix Issue 21040 - SIMD: illegal instruction using 32-byte operations on AVX" was merged into master:

- 32214270e7717ace7e2f8e8ee11612065068068b by Iain Buclaw:
  fix Issue 21040 - SIMD: illegal instruction using 32-byte operations on AVX

https://github.com/dlang/dmd/pull/11407