X86_AVX512VNNI: test _mm256_dpbusd_epi32 too#1944
Conversation
On RHEL9 the GCC is new enough to support AVX512-VNNI, but its assembler (binutils) is not and errors with ``` Error: unsupported instruction vpdpbusd ``` This was already addressed earlier in zlib-ng#1562 to some extent, except that a check for `_mm256_dpbusd_epi32` was not added, which is what the assembler errors over.
|
""" WalkthroughThe AVX512-VNNI intrinsics detection logic in both CMake and configure scripts was updated. The test code now checks for both 512-bit and 256-bit variants of the dpbusd intrinsic, using explicit zero-initialization and storing results in volatile variables. No changes were made to exported or public entities. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested labels
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (120)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1944 +/- ##
===========================================
+ Coverage 81.90% 81.91% +0.01%
===========================================
Files 162 162
Lines 13923 13924 +1
Branches 3122 3122
===========================================
+ Hits 11403 11406 +3
- Misses 1526 1540 +14
+ Partials 994 978 -16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cmake/detect-intrinsics.cmake
Outdated
| check_c_source_compiles([=[ | ||
| #include <immintrin.h> | ||
| int main(void) { | ||
| const __m512i z512 = _mm512_setzero_si512(); | ||
| const __m256i z256 = _mm256_setzero_si256(); | ||
| volatile __m512i r512 = _mm512_dpbusd_epi32(z512, z512, z512); | ||
| volatile __m256i r256 = _mm256_dpbusd_epi32(z256, z256, z256); | ||
| (void)r512; | ||
| (void)r256; | ||
| return 0; | ||
| } | ||
| ]=] |
There was a problem hiding this comment.
Quoting style doesn't match rest of the file.
On RHEL9 the GCC is new enough to support AVX512-VNNI, but its assembler
(binutils) is not and errors with
This was already addressed earlier in #1562 to some extent, except that
a check for
_mm256_dpbusd_epi32was not added, which is what theassembler errors over. So, check the 256 bit version as well.
After some more digging, seems that the difference is that when just
-mavx512vl -mavx512vnniflags are given, the following assembly isgenerated, which is not problematic for the assembler:
whereas with
-march=sapphirerapidsthe following is, which is apparentlyproblematic for the assembler:
Summary by CodeRabbit
Summary by CodeRabbit