@@ -12,6 +12,7 @@ pub(crate) fn codegen_cpuid_call<'tcx>(
12
12
) -> ( Value , Value , Value , Value ) {
13
13
let leaf_0 = fx. bcx . create_block ( ) ;
14
14
let leaf_1 = fx. bcx . create_block ( ) ;
15
+ let leaf_7 = fx. bcx . create_block ( ) ;
15
16
let leaf_8000_0000 = fx. bcx . create_block ( ) ;
16
17
let leaf_8000_0001 = fx. bcx . create_block ( ) ;
17
18
let unsupported_leaf = fx. bcx . create_block ( ) ;
@@ -25,6 +26,7 @@ pub(crate) fn codegen_cpuid_call<'tcx>(
25
26
let mut switch = cranelift_frontend:: Switch :: new ( ) ;
26
27
switch. set_entry ( 0 , leaf_0) ;
27
28
switch. set_entry ( 1 , leaf_1) ;
29
+ switch. set_entry ( 7 , leaf_7) ;
28
30
switch. set_entry ( 0x8000_0000 , leaf_8000_0000) ;
29
31
switch. set_entry ( 0x8000_0001 , leaf_8000_0001) ;
30
32
switch. emit ( & mut fx. bcx , leaf, unsupported_leaf) ;
@@ -43,6 +45,11 @@ pub(crate) fn codegen_cpuid_call<'tcx>(
43
45
let edx_features = fx. bcx . ins ( ) . iconst ( types:: I32 , 1 << 25 /* sse */ | 1 << 26 /* sse2 */ ) ;
44
46
fx. bcx . ins ( ) . jump ( dest, & [ cpu_signature, additional_information, ecx_features, edx_features] ) ;
45
47
48
+ fx. bcx . switch_to_block ( leaf_7) ;
49
+ // This leaf technically has subleaves, but we just return zero for all subleaves.
50
+ let zero = fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ;
51
+ fx. bcx . ins ( ) . jump ( dest, & [ zero, zero, zero, zero] ) ;
52
+
46
53
fx. bcx . switch_to_block ( leaf_8000_0000) ;
47
54
let extended_max_basic_leaf = fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ;
48
55
let zero = fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ;
0 commit comments