@@ -32,6 +32,9 @@ macro_rules! __unstable_detect_feature {
32
32
( "aes" , $unstable_detect_feature: path) => {
33
33
$unstable_detect_feature(
34
34
$crate:: __vendor_runtime:: __Feature:: aes{ } ) } ;
35
+ ( "tsc" , $unstable_detect_feature: path) => {
36
+ $unstable_detect_feature(
37
+ $crate:: __vendor_runtime:: __Feature:: tsc{ } ) } ;
35
38
( "mmx" , $unstable_detect_feature: path) => {
36
39
$unstable_detect_feature(
37
40
$crate:: __vendor_runtime:: __Feature:: mmx{ } ) } ;
@@ -173,6 +176,8 @@ macro_rules! __unstable_detect_feature {
173
176
pub enum __Feature {
174
177
/// AES (Advanced Encryption Standard New Instructions AES-NI)
175
178
aes,
179
+ /// TSC (Time Stamp Counter)
180
+ tsc,
176
181
/// MMX
177
182
mmx,
178
183
/// SSE (Streaming SIMD Extensions)
@@ -346,8 +351,9 @@ pub fn detect_features() -> usize {
346
351
enable ( proc_info_ecx, 20 , __Feature:: sse4_2) ;
347
352
enable ( proc_info_ecx, 23 , __Feature:: popcnt) ;
348
353
enable ( proc_info_ecx, 25 , __Feature:: aes) ;
349
- enable ( proc_info_edx, 24 , __Feature:: fxsr ) ;
354
+ enable ( proc_info_edx, 4 , __Feature:: tsc ) ;
350
355
enable ( proc_info_edx, 23 , __Feature:: mmx) ;
356
+ enable ( proc_info_edx, 24 , __Feature:: fxsr) ;
351
357
enable ( proc_info_edx, 25 , __Feature:: sse) ;
352
358
enable ( proc_info_edx, 26 , __Feature:: sse2) ;
353
359
@@ -457,6 +463,7 @@ mod tests {
457
463
#[ test]
458
464
fn dump ( ) {
459
465
println ! ( "aes: {:?}" , cfg_feature_enabled!( "aes" ) ) ;
466
+ println ! ( "tsc: {:?}" , cfg_feature_enabled!( "tsc" ) ) ;
460
467
println ! ( "sse: {:?}" , cfg_feature_enabled!( "sse" ) ) ;
461
468
println ! ( "sse2: {:?}" , cfg_feature_enabled!( "sse2" ) ) ;
462
469
println ! ( "sse3: {:?}" , cfg_feature_enabled!( "sse3" ) ) ;
@@ -497,6 +504,7 @@ mod tests {
497
504
fn compare_with_cupid ( ) {
498
505
let information = cupid:: master ( ) . unwrap ( ) ;
499
506
assert_eq ! ( cfg_feature_enabled!( "aes" ) , information. aesni( ) ) ;
507
+ assert_eq ! ( cfg_feature_enabled!( "tsc" ) , information. tsc( ) ) ;
500
508
assert_eq ! ( cfg_feature_enabled!( "sse" ) , information. sse( ) ) ;
501
509
assert_eq ! ( cfg_feature_enabled!( "sse2" ) , information. sse2( ) ) ;
502
510
assert_eq ! ( cfg_feature_enabled!( "sse3" ) , information. sse3( ) ) ;
0 commit comments