summaryrefslogtreecommitdiff
path: root/crypto/x86_64cpuid.pl
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-05-25 19:38:38 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-05-25 19:38:38 +0000
commit12df5ad9af4981f5d3c31a9819d31618c0f1af51 (patch)
tree97e3336a3054b8d8a0150b9d414934f73c99cb30 /crypto/x86_64cpuid.pl
parent5315173646e65b5025be33013edc33eb9658e683 (diff)
downloadsrc-test2-12df5ad9af4981f5d3c31a9819d31618c0f1af51.tar.gz
src-test2-12df5ad9af4981f5d3c31a9819d31618c0f1af51.zip
Import OpenSSL 1.0.2l.vendor/openssl/1.0.2l
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=318897 svn path=/vendor-crypto/openssl/1.0.2l/; revision=318898; tag=vendor/openssl/1.0.2l
Diffstat (limited to 'crypto/x86_64cpuid.pl')
-rw-r--r--crypto/x86_64cpuid.pl19
1 files changed, 10 insertions, 9 deletions
diff --git a/crypto/x86_64cpuid.pl b/crypto/x86_64cpuid.pl
index d208d02392e9..a3d6f438f91e 100644
--- a/crypto/x86_64cpuid.pl
+++ b/crypto/x86_64cpuid.pl
@@ -59,7 +59,7 @@ OPENSSL_ia32_cpuid:
mov %rbx,%r8 # save %rbx
xor %eax,%eax
- mov %eax,8(%rdi) # clear 3rd word
+ mov %eax,8(%rdi) # clear extended feature flags
cpuid
mov %eax,%r11d # max value for standard query level
@@ -127,14 +127,6 @@ OPENSSL_ia32_cpuid:
shr \$14,%r10d
and \$0xfff,%r10d # number of cores -1 per L1D
- cmp \$7,%r11d
- jb .Lnocacheinfo
-
- mov \$7,%eax
- xor %ecx,%ecx
- cpuid
- mov %ebx,8(%rdi)
-
.Lnocacheinfo:
mov \$1,%eax
cpuid
@@ -164,6 +156,15 @@ OPENSSL_ia32_cpuid:
or %ecx,%r9d # merge AMD XOP flag
mov %edx,%r10d # %r9d:%r10d is copy of %ecx:%edx
+
+ cmp \$7,%r11d
+ jb .Lno_extended_info
+ mov \$7,%eax
+ xor %ecx,%ecx
+ cpuid
+ mov %ebx,8(%rdi) # save extended feature flags
+.Lno_extended_info:
+
bt \$27,%r9d # check OSXSAVE bit
jnc .Lclear_avx
xor %ecx,%ecx # XCR0