Commit a38a2d02 authored by David du Colombier's avatar David du Colombier Committed by Russ Cox

crypto/sha512: fix checkAVX2

The checkAVX2 test doesn't appear to be correct,
because it always returns the value of support_bmi2,
even if the value of support_avx2 is false.

Consequently, checkAVX2 always returns true, as long
as BMI2 is supported, even if AVX2 is not supported.

We change checkAVX2 to return false when support_avx2
is false.

Fixes #19316.

Change-Id: I2ec9dfaa09f4b54c4a03d60efef891b955d60578
Reviewed-on: https://go-review.googlesource.com/37590
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent a8f07310
......@@ -1480,6 +1480,7 @@ TEXT ·checkAVX2(SB), NOSPLIT, $0
CMPB AX,$0
JNE check_bmi2
MOVB AX, ret+0(FP)
RET
check_bmi2:
MOVB runtime·support_bmi2(SB), AX
MOVB AX, ret+0(FP)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment