aboutsummaryrefslogtreecommitdiff
path: root/secure/lib/libcrypto/i386
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2017-05-25 20:52:16 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2017-05-25 20:52:16 +0000
commited7112f094e259f5ad6674b204d52543e831efa2 (patch)
treeef4498a709580a3a0881f49574a1922b277d9eef /secure/lib/libcrypto/i386
parent327f2e6c56c975c6f0e5333083e5309192681581 (diff)
parent12df5ad9af4981f5d3c31a9819d31618c0f1af51 (diff)
Notes
Diffstat (limited to 'secure/lib/libcrypto/i386')
-rw-r--r--secure/lib/libcrypto/i386/x86cpuid.S86
1 files changed, 42 insertions, 44 deletions
diff --git a/secure/lib/libcrypto/i386/x86cpuid.S b/secure/lib/libcrypto/i386/x86cpuid.S
index 738f30ced41d..90b0867bc4c8 100644
--- a/secure/lib/libcrypto/i386/x86cpuid.S
+++ b/secure/lib/libcrypto/i386/x86cpuid.S
@@ -23,10 +23,10 @@ OPENSSL_ia32_cpuid:
popl %eax
xorl %eax,%ecx
xorl %eax,%eax
- btl $21,%ecx
- jnc .L000nocpuid
movl 20(%esp),%esi
movl %eax,8(%esi)
+ btl $21,%ecx
+ jnc .L000nocpuid
.byte 0x0f,0xa2
movl %eax,%edi
xorl %eax,%eax
@@ -77,40 +77,32 @@ OPENSSL_ia32_cpuid:
andl $4026531839,%edx
jmp .L002generic
.L001intel:
- cmpl $7,%edi
- jb .L003cacheinfo
- movl 20(%esp),%esi
- movl $7,%eax
- xorl %ecx,%ecx
- .byte 0x0f,0xa2
- movl %ebx,8(%esi)
-.L003cacheinfo:
cmpl $4,%edi
- movl $-1,%edi
- jb .L004nocacheinfo
+ movl $-1,%esi
+ jb .L003nocacheinfo
movl $4,%eax
movl $0,%ecx
.byte 0x0f,0xa2
- movl %eax,%edi
- shrl $14,%edi
- andl $4095,%edi
-.L004nocacheinfo:
+ movl %eax,%esi
+ shrl $14,%esi
+ andl $4095,%esi
+.L003nocacheinfo:
movl $1,%eax
xorl %ecx,%ecx
.byte 0x0f,0xa2
andl $3220176895,%edx
cmpl $0,%ebp
- jne .L005notintel
+ jne .L004notintel
orl $1073741824,%edx
andb $15,%ah
cmpb $15,%ah
- jne .L005notintel
+ jne .L004notintel
orl $1048576,%edx
-.L005notintel:
+.L004notintel:
btl $28,%edx
jnc .L002generic
andl $4026531839,%edx
- cmpl $0,%edi
+ cmpl $0,%esi
je .L002generic
orl $268435456,%edx
shrl $16,%ebx
@@ -122,7 +114,15 @@ OPENSSL_ia32_cpuid:
andl $4294965247,%ecx
movl %edx,%esi
orl %ecx,%ebp
- btl $27,%ecx
+ cmpl $7,%edi
+ movl 20(%esp),%edi
+ jb .L005no_extended_info
+ movl $7,%eax
+ xorl %ecx,%ecx
+ .byte 0x0f,0xa2
+ movl %ebx,8(%edi)
+.L005no_extended_info:
+ btl $27,%ebp
jnc .L006clear_avx
xorl %ecx,%ecx
.byte 15,1,208
@@ -136,7 +136,6 @@ OPENSSL_ia32_cpuid:
andl $4278190079,%esi
.L006clear_avx:
andl $4026525695,%ebp
- movl 20(%esp),%edi
andl $4294967263,8(%edi)
.L007done:
movl %esi,%eax
@@ -396,10 +395,10 @@ OPENSSL_ia32_cpuid:
popl %eax
xorl %eax,%ecx
xorl %eax,%eax
- btl $21,%ecx
- jnc .L000nocpuid
movl 20(%esp),%esi
movl %eax,8(%esi)
+ btl $21,%ecx
+ jnc .L000nocpuid
.byte 0x0f,0xa2
movl %eax,%edi
xorl %eax,%eax
@@ -450,40 +449,32 @@ OPENSSL_ia32_cpuid:
andl $4026531839,%edx
jmp .L002generic
.L001intel:
- cmpl $7,%edi
- jb .L003cacheinfo
- movl 20(%esp),%esi
- movl $7,%eax
- xorl %ecx,%ecx
- .byte 0x0f,0xa2
- movl %ebx,8(%esi)
-.L003cacheinfo:
cmpl $4,%edi
- movl $-1,%edi
- jb .L004nocacheinfo
+ movl $-1,%esi
+ jb .L003nocacheinfo
movl $4,%eax
movl $0,%ecx
.byte 0x0f,0xa2
- movl %eax,%edi
- shrl $14,%edi
- andl $4095,%edi
-.L004nocacheinfo:
+ movl %eax,%esi
+ shrl $14,%esi
+ andl $4095,%esi
+.L003nocacheinfo:
movl $1,%eax
xorl %ecx,%ecx
.byte 0x0f,0xa2
andl $3220176895,%edx
cmpl $0,%ebp
- jne .L005notintel
+ jne .L004notintel
orl $1073741824,%edx
andb $15,%ah
cmpb $15,%ah
- jne .L005notintel
+ jne .L004notintel
orl $1048576,%edx
-.L005notintel:
+.L004notintel:
btl $28,%edx
jnc .L002generic
andl $4026531839,%edx
- cmpl $0,%edi
+ cmpl $0,%esi
je .L002generic
orl $268435456,%edx
shrl $16,%ebx
@@ -495,7 +486,15 @@ OPENSSL_ia32_cpuid:
andl $4294965247,%ecx
movl %edx,%esi
orl %ecx,%ebp
- btl $27,%ecx
+ cmpl $7,%edi
+ movl 20(%esp),%edi
+ jb .L005no_extended_info
+ movl $7,%eax
+ xorl %ecx,%ecx
+ .byte 0x0f,0xa2
+ movl %ebx,8(%edi)
+.L005no_extended_info:
+ btl $27,%ebp
jnc .L006clear_avx
xorl %ecx,%ecx
.byte 15,1,208
@@ -509,7 +508,6 @@ OPENSSL_ia32_cpuid:
andl $4278190079,%esi
.L006clear_avx:
andl $4026525695,%ebp
- movl 20(%esp),%edi
andl $4294967263,8(%edi)
.L007done:
movl %esi,%eax