Skip to content

s390x_is_feature_detected!: detect more features #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
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.vxrs_bcd);

// 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_2, 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