We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddc49a0 commit 3dec358Copy full SHA for 3dec358
crates/core_arch/src/x86/f16c.rs
@@ -1,5 +1,6 @@
1
-//! F16C intrinsics:
2
-//! https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=fp16&expand=1769
+//! [F16C intrinsics].
+//!
3
+//! [F16C intrinsics]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=fp16&expand=1769
4
5
use crate::{
6
core_arch::{simd::*, x86::*},
crates/core_arch/tests/cpu-detection.rs
@@ -31,6 +31,7 @@ fn x86_all() {
31
"avx512_vpopcntdq {:?}",
32
is_x86_feature_detected!("avx512vpopcntdq")
33
);
34
+ println!("f16c: {:?}", is_x86_feature_detected!("f16c"));
35
println!("fma: {:?}", is_x86_feature_detected!("fma"));
36
println!("abm: {:?}", is_x86_feature_detected!("abm"));
37
println!("bmi: {:?}", is_x86_feature_detected!("bmi1"));
crates/std_detect/src/detect/arch/x86.rs
@@ -62,6 +62,7 @@
62
/// * `"avx512ifma"`
63
/// * `"avx512vbmi"`
64
/// * `"avx512vpopcntdq"`
65
+/// * `"f16c"`
66
/// * `"fma"`
67
/// * `"bmi1"`
68
/// * `"bmi2"`
@@ -179,6 +180,10 @@ macro_rules! is_x86_feature_detected {
179
180
cfg!(target_feature = "avx512vpopcntdq") || $crate::detect::check_for(
181
$crate::detect::Feature::avx512_vpopcntdq)
182
};
183
+ ("f16c") => {
184
+ cfg!(target_feature = "avx512f") || $crate::detect::check_for(
185
+ $crate::detect::Feature::f16c)
186
+ };
187
("fma") => {
188
cfg!(target_feature = "fma") || $crate::detect::check_for(
189
$crate::detect::Feature::fma)
@@ -309,6 +314,8 @@ pub enum Feature {
309
314
/// AVX-512 VPOPCNTDQ (Vector Population Count Doubleword and
310
315
/// Quadword)
311
316
avx512_vpopcntdq,
317
+ /// F16C (Conversions between IEEE-754 `binary16` and `binary32` formats)
318
+ f16c,
312
319
/// FMA (Fused Multiply Add)
313
320
fma,
321
/// BMI1 (Bit Manipulation Instructions 1)
crates/std_detect/src/detect/os/x86.rs
@@ -113,13 +113,14 @@ fn detect_features() -> cache::Initializer {
113
114
115
enable(proc_info_ecx, 0, Feature::sse3);
116
+ enable(proc_info_ecx, 1, Feature::pclmulqdq);
117
enable(proc_info_ecx, 9, Feature::ssse3);
118
enable(proc_info_ecx, 13, Feature::cmpxchg16b);
119
enable(proc_info_ecx, 19, Feature::sse4_1);
120
enable(proc_info_ecx, 20, Feature::sse4_2);
121
enable(proc_info_ecx, 23, Feature::popcnt);
122
enable(proc_info_ecx, 25, Feature::aes);
- enable(proc_info_ecx, 1, Feature::pclmulqdq);
123
+ enable(proc_info_ecx, 29, Feature::f16c);
124
enable(proc_info_ecx, 30, Feature::rdrand);
125
enable(extended_features_ebx, 18, Feature::rdseed);
126
enable(extended_features_ebx, 19, Feature::adx);
crates/std_detect/tests/cpu-detection.rs
@@ -87,6 +87,7 @@ fn x86_all() {
87
88
89
90
91
92
println!("bmi1: {:?}", is_x86_feature_detected!("bmi1"));
93
println!("bmi2: {:?}", is_x86_feature_detected!("bmi2"));
0 commit comments