summaryrefslogtreecommitdiff
path: root/apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S
diff options
context:
space:
mode:
Diffstat (limited to 'apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S')
-rw-r--r--apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S51
1 files changed, 32 insertions, 19 deletions
diff --git a/apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S b/apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S
index a1ea1e6b..6af67444 100644
--- a/apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S
+++ b/apple-x86_64/crypto/fipsmodule/sha1-x86_64-apple.S
@@ -6,13 +6,34 @@
#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && defined(__APPLE__)
.text
-.globl _sha1_block_data_order_nohw
-.private_extern _sha1_block_data_order_nohw
+
+.globl _sha1_block_data_order
+.private_extern _sha1_block_data_order
.p2align 4
-_sha1_block_data_order_nohw:
+_sha1_block_data_order:
_CET_ENDBR
+ leaq _OPENSSL_ia32cap_P(%rip),%r10
+ movl 0(%r10),%r9d
+ movl 4(%r10),%r8d
+ movl 8(%r10),%r10d
+ testl $512,%r8d
+ jz L$ialu
+ testl $536870912,%r10d
+ jnz _shaext_shortcut
+ andl $296,%r10d
+ cmpl $296,%r10d
+ je _avx2_shortcut
+ andl $268435456,%r8d
+ andl $1073741824,%r9d
+ orl %r9d,%r8d
+ cmpl $1342177280,%r8d
+ je _avx_shortcut
+ jmp _ssse3_shortcut
+
+.p2align 4
+L$ialu:
movq %rsp,%rax
pushq %rbx
@@ -1243,13 +1264,11 @@ L$epilogue:
ret
-.globl _sha1_block_data_order_hw
-.private_extern _sha1_block_data_order_hw
.p2align 5
-_sha1_block_data_order_hw:
+sha1_block_data_order_shaext:
+_shaext_shortcut:
-_CET_ENDBR
movdqu (%rdi),%xmm0
movd 16(%rdi),%xmm1
movdqa K_XX_XX+160(%rip),%xmm3
@@ -1415,13 +1434,11 @@ L$oop_shaext:
ret
-.globl _sha1_block_data_order_ssse3
-.private_extern _sha1_block_data_order_ssse3
.p2align 4
-_sha1_block_data_order_ssse3:
+sha1_block_data_order_ssse3:
+_ssse3_shortcut:
-_CET_ENDBR
movq %rsp,%r11
pushq %rbx
@@ -2605,13 +2622,11 @@ L$epilogue_ssse3:
ret
-.globl _sha1_block_data_order_avx
-.private_extern _sha1_block_data_order_avx
.p2align 4
-_sha1_block_data_order_avx:
+sha1_block_data_order_avx:
+_avx_shortcut:
-_CET_ENDBR
movq %rsp,%r11
pushq %rbx
@@ -3735,13 +3750,11 @@ L$epilogue_avx:
ret
-.globl _sha1_block_data_order_avx2
-.private_extern _sha1_block_data_order_avx2
.p2align 4
-_sha1_block_data_order_avx2:
+sha1_block_data_order_avx2:
+_avx2_shortcut:
-_CET_ENDBR
movq %rsp,%r11
pushq %rbx