Skip to content

Commit

Permalink
add newly-added s390x features to is_s390x_feature_detected
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Feb 23, 2025
1 parent a70790e commit aa32463
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
33 changes: 33 additions & 0 deletions crates/std_detect/src/detect/arch/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ features! {
@MACRO_ATTRS:
/// Checks if `s390x` feature is enabled.
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] deflate_conversion: "deflate-conversion";
/// s390x deflate-conversion facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] enhanced_sort: "enhanced-sort";
/// s390x enhanced-sort facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] guarded_storage: "guarded-storage";
/// s390x guarded-storage facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] high_word: "high-word";
/// s390x high-word facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] nnp_assist: "nnp-assist";
/// s390x nnp-assist facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] transactional_execution: "transactional-execution";
/// s390x transactional-execution facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector: "vector";
/// s390x vector facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_enhancements_1: "vector-enhancements-1";
/// s390x vector-enhancements-1 facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_enhancements_2: "vector-enhancements-2";
/// s390x vector-enhancements-2 facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal: "vector-packed-decimal";
/// s390x vector-packed-decimal facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal_enhancement: "vector-packed-decimal-enhancement";
/// s390x vector-packed-decimal-enhancement facility
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal_enhancement_2: "vector-packed-decimal-enhancement-2";
/// s390x vector-packed-decimal-enhancement-2 facility
}
37 changes: 37 additions & 0 deletions crates/std_detect/src/detect/os/linux/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,45 @@ impl AtHwcap {
}
};

// vector and related

// bit 129 of the extended facility list
enable_feature(Feature::vector, self.vxrs);

// bit 135 of the extended facility list
enable_feature(Feature::vector_enhancements_1, self.vxrs_ext);

// bit 148 of the extended facility list
enable_feature(Feature::vector_enhancements_2, self.vxrs_ext2);

// bit 134 of the extended facility list
enable_feature(Feature::vector_packed_decimal, self.dfp); // TODO I think this is wrong

// bit 152 of the extended facility list
enable_feature(Feature::vector_packed_decimal_enhancement, self.vxrs_pde);

// bit 192 of the extended facility list
enable_feature(Feature::vector_packed_decimal_enhancement, self.vxrs_pde2);

// bit 165 of the extended facility list
enable_feature(Feature::nnp_assist, self.nnpa);

// others

// bit 45 of the extended facility list
enable_feature(Feature::high_word, self.high_gprs);

// bit 73 of the extended facility list
enable_feature(Feature::transactional_execution, self.te);

// bit 133 of the extended facility list
enable_feature(Feature::guarded_storage, self.gs);

// bit 150 of the extended facility list
enable_feature(Feature::enhanced_sort, self.sort);

// bit 151 of the extended facility list
enable_feature(Feature::deflate_conversion, self.dflt);
}
value
}
Expand Down

0 comments on commit aa32463

Please # to comment.