From 38e6b637b71fae274caedc1d326f641b904e00a4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Feb 2022 17:54:40 -0800 Subject: CMake: add detection of x86 VAES and AVX512VBMI2 features We have VAES code in qhash.cpp that isn't getting compiled right now. Change-Id: Ibf4acec0f166495998f7fffd16d6961261dec361 Reviewed-by: Qt CI Bot Reviewed-by: Allan Sandfeld Jensen --- config.tests/x86_simd/main.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'config.tests') diff --git a/config.tests/x86_simd/main.cpp b/config.tests/x86_simd/main.cpp index 29c8b97c12..4f51e59a55 100644 --- a/config.tests/x86_simd/main.cpp +++ b/config.tests/x86_simd/main.cpp @@ -264,6 +264,26 @@ attribute_target("avx512ifma") void test_avx512ifma() } #endif +#if T(AVX512VBMI2) +attribute_target("avx512vl,avx512vbmi2") void test_avx512vbmi2() +{ + /* AVX512 Vector Byte Manipulation Instructions 2 */ + __m128i a = _mm_maskz_compress_epi16(-1, _mm_set1_epi16(1)); + __m128i b = _mm_shrdi_epi32(a, a, 7); +} +#endif + +#if T(VAES) +// VAES does not require AVX512 and works on Alder Lake +attribute_target("avx2,vaes") void test_vaes() +{ + /* 256- and 512-bit AES */ + __m256i a = _mm256_set1_epi32(-1); + __m256i b = _mm256_aesenc_epi128(a, a); + __m256i c = _mm256_aesdec_epi128(b, a); +} +#endif + int main() { return 0; -- cgit v1.2.3