Skip to content

Commit

Permalink
undo the src/tools/rustfmt/tests/ changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zmodem committed May 24, 2024
1 parent 63050af commit f59d7f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/tools/rustfmt/tests/target/cfg_if/detect/arch/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
/// * `"avx2"`
/// * `"avx512f"`
/// * `"avx512cd"`
/// * `"avx512er"`
/// * `"avx512pf"`
/// * `"avx512bw"`
/// * `"avx512dq"`
/// * `"avx512vl"`
Expand Down Expand Up @@ -142,6 +144,14 @@ macro_rules! is_x86_feature_detected {
cfg!(target_feature = "avx512cd")
|| $crate::detect::check_for($crate::detect::Feature::avx512cd)
};
("avx512er") => {
cfg!(target_feature = "avx512er")
|| $crate::detect::check_for($crate::detect::Feature::avx512er)
};
("avx512pf") => {
cfg!(target_feature = "avx512pf")
|| $crate::detect::check_for($crate::detect::Feature::avx512pf)
};
("avx512bw") => {
cfg!(target_feature = "avx512bw")
|| $crate::detect::check_for($crate::detect::Feature::avx512bw)
Expand Down
6 changes: 6 additions & 0 deletions src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ fn detect_features() -> cache::Initializer {
enable(extended_features_ebx, 16, Feature::avx512f);
enable(extended_features_ebx, 17, Feature::avx512dq);
enable(extended_features_ebx, 21, Feature::avx512_ifma);
enable(extended_features_ebx, 26, Feature::avx512pf);
enable(extended_features_ebx, 27, Feature::avx512er);
enable(extended_features_ebx, 28, Feature::avx512cd);
enable(extended_features_ebx, 30, Feature::avx512bw);
enable(extended_features_ebx, 31, Feature::avx512vl);
Expand Down Expand Up @@ -270,6 +272,8 @@ mod tests {
println!("avx2: {:?}", is_x86_feature_detected!("avx2"));
println!("avx512f {:?}", is_x86_feature_detected!("avx512f"));
println!("avx512cd {:?}", is_x86_feature_detected!("avx512cd"));
println!("avx512er {:?}", is_x86_feature_detected!("avx512er"));
println!("avx512pf {:?}", is_x86_feature_detected!("avx512pf"));
println!("avx512bw {:?}", is_x86_feature_detected!("avx512bw"));
println!("avx512dq {:?}", is_x86_feature_detected!("avx512dq"));
println!("avx512vl {:?}", is_x86_feature_detected!("avx512vl"));
Expand Down Expand Up @@ -319,6 +323,8 @@ mod tests {
assert_eq!(is_x86_feature_detected!("avx2"), information.avx2());
assert_eq!(is_x86_feature_detected!("avx512f"), information.avx512f());
assert_eq!(is_x86_feature_detected!("avx512cd"), information.avx512cd());
assert_eq!(is_x86_feature_detected!("avx512er"), information.avx512er());
assert_eq!(is_x86_feature_detected!("avx512pf"), information.avx512pf());
assert_eq!(is_x86_feature_detected!("avx512bw"), information.avx512bw());
assert_eq!(is_x86_feature_detected!("avx512dq"), information.avx512dq());
assert_eq!(is_x86_feature_detected!("avx512vl"), information.avx512vl());
Expand Down

0 comments on commit f59d7f2

Please sign in to comment.