Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpufeatures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ Target features:
- `sse4.1`
- `sse4.2`
- `ssse3`
- `sha512`
- `sm3`
- `sm4`

If you would like detection support for a target feature which is not on
this list, please [open a GitHub issue].
Expand Down
6 changes: 5 additions & 1 deletion cpufeatures/src/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ macro_rules! __detect_target_features {
}

let cr = unsafe {
[cpuid(1), cpuid_count(7, 0)]
[cpuid(1), cpuid_count(7, 0), cpuid_count(7, 1)]
};

$($crate::check!(cr, $tf) & )+ true
Expand Down Expand Up @@ -142,4 +142,8 @@ __expand_check_macro! {
("vpclmulqdq", "zmm", 1, ecx, 10),
("avx512bitalg", "zmm", 1, ecx, 12),
("avx512vpopcntdq", "zmm", 1, ecx, 14),

("sha512", "ymm", 2, eax, 0),
("sm3", "xmm", 2, eax, 1),
("sm4", "ymm", 2, eax, 2),
}