@@ -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
+ ( "pclmul" , $unstable_detect_feature: path) => {
36
+ $unstable_detect_feature(
37
+ $crate:: __vendor_runtime:: __Feature:: pclmul{ } ) } ;
35
38
( "tsc" , $unstable_detect_feature: path) => {
36
39
$unstable_detect_feature(
37
40
$crate:: __vendor_runtime:: __Feature:: tsc{ } ) } ;
@@ -176,6 +179,8 @@ macro_rules! __unstable_detect_feature {
176
179
pub enum __Feature {
177
180
/// AES (Advanced Encryption Standard New Instructions AES-NI)
178
181
aes,
182
+ /// CLMUL (Carry-less Multiplication)
183
+ pclmul,
179
184
/// TSC (Time Stamp Counter)
180
185
tsc,
181
186
/// MMX
@@ -351,6 +356,7 @@ pub fn detect_features() -> cache::Initializer {
351
356
enable ( proc_info_ecx, 20 , __Feature:: sse4_2) ;
352
357
enable ( proc_info_ecx, 23 , __Feature:: popcnt) ;
353
358
enable ( proc_info_ecx, 25 , __Feature:: aes) ;
359
+ enable ( proc_info_ecx, 1 , __Feature:: pclmul) ;
354
360
enable ( proc_info_edx, 4 , __Feature:: tsc) ;
355
361
enable ( proc_info_edx, 23 , __Feature:: mmx) ;
356
362
enable ( proc_info_edx, 24 , __Feature:: fxsr) ;
@@ -463,6 +469,7 @@ mod tests {
463
469
#[ test]
464
470
fn dump ( ) {
465
471
println ! ( "aes: {:?}" , cfg_feature_enabled!( "aes" ) ) ;
472
+ println ! ( "pclmul: {:?}" , cfg_feature_enabled!( "pclmul" ) ) ;
466
473
println ! ( "tsc: {:?}" , cfg_feature_enabled!( "tsc" ) ) ;
467
474
println ! ( "sse: {:?}" , cfg_feature_enabled!( "sse" ) ) ;
468
475
println ! ( "sse2: {:?}" , cfg_feature_enabled!( "sse2" ) ) ;
@@ -504,6 +511,7 @@ mod tests {
504
511
fn compare_with_cupid ( ) {
505
512
let information = cupid:: master ( ) . unwrap ( ) ;
506
513
assert_eq ! ( cfg_feature_enabled!( "aes" ) , information. aesni( ) ) ;
514
+ assert_eq ! ( cfg_feature_enabled!( "pclmul" ) , information. pclmulqdq( ) ) ;
507
515
assert_eq ! ( cfg_feature_enabled!( "tsc" ) , information. tsc( ) ) ;
508
516
assert_eq ! ( cfg_feature_enabled!( "sse" ) , information. sse( ) ) ;
509
517
assert_eq ! ( cfg_feature_enabled!( "sse2" ) , information. sse2( ) ) ;
0 commit comments