Skip to content

Commit aa32463

Browse files
committed
add newly-added s390x features to is_s390x_feature_detected
1 parent a70790e commit aa32463

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

crates/std_detect/src/detect/arch/s390x.rs

+33
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,39 @@ features! {
77
@MACRO_ATTRS:
88
/// Checks if `s390x` feature is enabled.
99
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
10+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] deflate_conversion: "deflate-conversion";
11+
/// s390x deflate-conversion facility
12+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
13+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] enhanced_sort: "enhanced-sort";
14+
/// s390x enhanced-sort facility
15+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
16+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] guarded_storage: "guarded-storage";
17+
/// s390x guarded-storage facility
18+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
19+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] high_word: "high-word";
20+
/// s390x high-word facility
21+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
22+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] nnp_assist: "nnp-assist";
23+
/// s390x nnp-assist facility
24+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
25+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] transactional_execution: "transactional-execution";
26+
/// s390x transactional-execution facility
27+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
1028
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector: "vector";
1129
/// s390x vector facility
30+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
31+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_enhancements_1: "vector-enhancements-1";
32+
/// s390x vector-enhancements-1 facility
33+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
34+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_enhancements_2: "vector-enhancements-2";
35+
/// s390x vector-enhancements-2 facility
36+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
37+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal: "vector-packed-decimal";
38+
/// s390x vector-packed-decimal facility
39+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
40+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal_enhancement: "vector-packed-decimal-enhancement";
41+
/// s390x vector-packed-decimal-enhancement facility
42+
#[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")]
43+
@FEATURE: #[unstable(feature = "stdarch_s390x_feature_detection", issue = "135413")] vector_packed_decimal_enhancement_2: "vector-packed-decimal-enhancement-2";
44+
/// s390x vector-packed-decimal-enhancement-2 facility
1245
}

crates/std_detect/src/detect/os/linux/s390x.rs

+37
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,45 @@ impl AtHwcap {
8787
}
8888
};
8989

90+
// vector and related
91+
9092
// bit 129 of the extended facility list
9193
enable_feature(Feature::vector, self.vxrs);
94+
95+
// bit 135 of the extended facility list
96+
enable_feature(Feature::vector_enhancements_1, self.vxrs_ext);
97+
98+
// bit 148 of the extended facility list
99+
enable_feature(Feature::vector_enhancements_2, self.vxrs_ext2);
100+
101+
// bit 134 of the extended facility list
102+
enable_feature(Feature::vector_packed_decimal, self.dfp); // TODO I think this is wrong
103+
104+
// bit 152 of the extended facility list
105+
enable_feature(Feature::vector_packed_decimal_enhancement, self.vxrs_pde);
106+
107+
// bit 192 of the extended facility list
108+
enable_feature(Feature::vector_packed_decimal_enhancement, self.vxrs_pde2);
109+
110+
// bit 165 of the extended facility list
111+
enable_feature(Feature::nnp_assist, self.nnpa);
112+
113+
// others
114+
115+
// bit 45 of the extended facility list
116+
enable_feature(Feature::high_word, self.high_gprs);
117+
118+
// bit 73 of the extended facility list
119+
enable_feature(Feature::transactional_execution, self.te);
120+
121+
// bit 133 of the extended facility list
122+
enable_feature(Feature::guarded_storage, self.gs);
123+
124+
// bit 150 of the extended facility list
125+
enable_feature(Feature::enhanced_sort, self.sort);
126+
127+
// bit 151 of the extended facility list
128+
enable_feature(Feature::deflate_conversion, self.dflt);
92129
}
93130
value
94131
}

0 commit comments

Comments
 (0)