Commit 9779b18 1 parent 818c71d commit 9779b18 Copy full SHA for 9779b18
File tree 3 files changed +17
-1
lines changed
3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ features! {
103
103
/// * `"xsaves"`
104
104
/// * `"xsavec"`
105
105
/// * `"cmpxchg16b"`
106
+ /// * `"kl"`
107
+ /// * `"widekl"`
106
108
/// * `"adx"`
107
109
/// * `"rtm"`
108
110
/// * `"movbe"`
@@ -241,6 +243,10 @@ features! {
241
243
/// XSAVEC (Save Processor Extended States Compacted)
242
244
@FEATURE : #[ stable( feature = "simd_x86" , since = "1.27.0" ) ] cmpxchg16b: "cmpxchg16b" ;
243
245
/// CMPXCH16B (16-byte compare-and-swap instruction)
246
+ @FEATURE : #[ unstable( feature = "keylocker_x86" , issue = "134813" ) ] kl: "kl" ;
247
+ /// Intel Key Locker
248
+ @FEATURE : #[ unstable( feature = "keylocker_x86" , issue = "134813" ) ] widekl: "widekl" ;
249
+ /// Intel Key Locker Wide
244
250
@FEATURE : #[ stable( feature = "simd_x86_adx" , since = "1.33.0" ) ] adx: "adx" ;
245
251
/// ADX, Intel ADX (Multi-Precision Add-Carry Instruction Extensions)
246
252
@FEATURE : #[ stable( feature = "simd_x86" , since = "1.27.0" ) ] rtm: "rtm" ;
Original file line number Diff line number Diff line change @@ -141,6 +141,13 @@ pub(crate) fn detect_features() -> cache::Initializer {
141
141
142
142
enable ( extended_features_ebx, 9 , Feature :: ermsb) ;
143
143
144
+ // Detect if CPUID.19h available
145
+ if bit:: test ( extended_features_ecx as usize , 23 ) {
146
+ let CpuidResult { ebx, .. } = unsafe { __cpuid ( 0x19 ) } ;
147
+ enable ( ebx, 0 , Feature :: kl) ;
148
+ enable ( ebx, 2 , Feature :: widekl) ;
149
+ }
150
+
144
151
// `XSAVE` and `AVX` support:
145
152
let cpu_xsave = bit:: test ( proc_info_ecx as usize , 26 ) ;
146
153
if cpu_xsave {
Original file line number Diff line number Diff line change 5
5
avx512_target_feature,
6
6
sha512_sm_x86,
7
7
x86_amx_intrinsics,
8
- xop_target_feature
8
+ xop_target_feature,
9
+ keylocker_x86
9
10
) ]
10
11
11
12
extern crate cupid;
@@ -94,6 +95,8 @@ fn dump() {
94
95
println ! ( "amx-fp16: {:?}" , is_x86_feature_detected!( "amx-fp16" ) ) ;
95
96
println ! ( "amx-complex: {:?}" , is_x86_feature_detected!( "amx-complex" ) ) ;
96
97
println ! ( "xop: {:?}" , is_x86_feature_detected!( "xop" ) ) ;
98
+ println ! ( "kl: {:?}" , is_x86_feature_detected!( "kl" ) ) ;
99
+ println ! ( "widekl: {:?}" , is_x86_feature_detected!( "widekl" ) ) ;
97
100
}
98
101
99
102
#[ cfg( feature = "std_detect_env_override" ) ]
You can’t perform that action at this time.
0 commit comments