From 1ffdfbecbe55818c7c7a1e0c6472244e9c546a2f Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Fri, 24 Mar 2023 13:58:19 -0600 Subject: [PATCH] cpufeatures: add support for detecting AVX-512 (#862) Adds support for detecting the following features: - `avx512f` - `avx512dq` - `avx512ifma` - `avx512pf` - `avx512er` - `avx512cd` - `avx512bw` - `avx512vl` CPUID bitflags obtained from this table: https://en.wikichip.org/wiki/x86/avx-512#Detection Closes #815 --- cpufeatures/src/x86.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpufeatures/src/x86.rs b/cpufeatures/src/x86.rs index c973b744..a60fa0d3 100644 --- a/cpufeatures/src/x86.rs +++ b/cpufeatures/src/x86.rs @@ -99,7 +99,15 @@ __expand_check_macro! { ("bmi1", 1, ebx, 3), ("avx2", 0, ecx, 28, 1, ebx, 5), ("bmi2", 1, ebx, 8), + ("avx512f", 1, ebx, 16), + ("avx512dq", 1, ebx, 17), ("rdseed", 1, ebx, 18), ("adx", 1, ebx, 19), + ("avx512ifma", 1, ebx, 21), + ("avx512pf", 1, ebx, 26), + ("avx512er", 1, ebx, 27), + ("avx512cd", 1, ebx, 28), ("sha", 1, ebx, 29), + ("avx512bw", 1, ebx, 30), + ("avx512vl", 1, ebx, 31), }