Fixes #27555
When $avx>1, codegen is:
lea OPENSSL_ia32cap_P(%rip),%r10
mov 0(%r10),%r9
mov 8(%r10),%r11d
mov 20(%r10),%r10d
When $avx is true, codegen was:
lea OPENSSL_ia32cap_P(%rip),%r10
mov 0(%r10),%r9
mov 8(%r10),%r11d
mov 20(%r10),%r10d # not used by dispatcher
When $avx=0, codegen was:
mov 20(%r10),%r10d # %r10 not initalized, causing SIGSEGV
After fix, `mov 20(%r10),%r10d` is only included when $avx>1
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27574)
mov 0(%r10),%r9
mov 8(%r10),%r11d
___
-$code.=<<___ if ($SZ==8);
+$code.=<<___ if ($SZ==8 && $avx>1);
mov 20(%r10),%r10d
___
if ($SZ==4) {
$code.=<<___;
test \$`1<<5`,%r11d # check for AVX2
jz .Lavx_dispatch
-___
-$code.=<<___ if ($SZ==8);
test \$`1<<0`,%r10d # AVX2 confirmed, check SHA512
jnz .Lsha512ext_shortcut
-___
-$code.=<<___;
and \$`1<<8|1<<3`,%r11d # AVX2 confirmed, check BMI2+BMI1
cmp \$`1<<8|1<<3`,%r11d
je .Lavx2_shortcut