Pretend AMD XOP was never a thing.
It's not clear that any AMD XOP code paths are being properly tested. AMD dropped XOP starting in Zen. Here's the one place I found (without looking too hard) where it seems there is a XOP code path in BoringSSL, in sha512-x86_64.pl. Most of the other XOP code was removed. ``` $code.=<<___ if ($avx && $SZ==8); test \$`1<<11`,%r10d # check for XOP jnz .Lxop_shortcut ``` Change-Id: Id3301b2c84648790d010dae546b8e21ece1c528d Reviewed-on: https://boringssl-review.googlesource.com/c/33405 Reviewed-by: David Benjamin <davidben@google.com> Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
This commit is contained in:
parent
e6ad7a027f
commit
36ee9a5a0d
@ -148,23 +148,6 @@ void OPENSSL_cpuid_setup(void) {
|
|||||||
int is_intel = ebx == 0x756e6547 /* Genu */ &&
|
int is_intel = ebx == 0x756e6547 /* Genu */ &&
|
||||||
edx == 0x49656e69 /* ineI */ &&
|
edx == 0x49656e69 /* ineI */ &&
|
||||||
ecx == 0x6c65746e /* ntel */;
|
ecx == 0x6c65746e /* ntel */;
|
||||||
int is_amd = ebx == 0x68747541 /* Auth */ &&
|
|
||||||
edx == 0x69746e65 /* enti */ &&
|
|
||||||
ecx == 0x444d4163 /* cAMD */;
|
|
||||||
|
|
||||||
int has_amd_xop = 0;
|
|
||||||
if (is_amd) {
|
|
||||||
// AMD-specific logic.
|
|
||||||
// See http://developer.amd.com/wordpress/media/2012/10/254811.pdf
|
|
||||||
OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000000);
|
|
||||||
uint32_t num_extended_ids = eax;
|
|
||||||
if (num_extended_ids >= 0x80000001) {
|
|
||||||
OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000001);
|
|
||||||
if (ecx & (1u << 11)) {
|
|
||||||
has_amd_xop = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t extended_features[2] = {0};
|
uint32_t extended_features[2] = {0};
|
||||||
if (num_ids >= 7) {
|
if (num_ids >= 7) {
|
||||||
@ -198,12 +181,9 @@ void OPENSSL_cpuid_setup(void) {
|
|||||||
edx &= ~(1u << 30);
|
edx &= ~(1u << 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The SDBG bit is repurposed to denote AMD XOP support.
|
// The SDBG bit is repurposed to denote AMD XOP support. Don't ever use AMD
|
||||||
if (has_amd_xop) {
|
// XOP code paths.
|
||||||
ecx |= (1u << 11);
|
ecx &= ~(1u << 11);
|
||||||
} else {
|
|
||||||
ecx &= ~(1u << 11);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t xcr0 = 0;
|
uint64_t xcr0 = 0;
|
||||||
if (ecx & (1u << 27)) {
|
if (ecx & (1u << 27)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user