arm64cpuid.S revision 1.1
1#include "arm_arch.h" 2 3.text 4.arch armv8-a+crypto 5 6.align 5 7.globl _armv7_neon_probe 8.type _armv7_neon_probe,%function 9_armv7_neon_probe: 10 orr v15.16b, v15.16b, v15.16b 11 ret 12.size _armv7_neon_probe,.-_armv7_neon_probe 13 14.globl _armv7_tick 15.type _armv7_tick,%function 16_armv7_tick: 17#ifdef __APPLE__ 18 mrs x0, CNTPCT_EL0 19#else 20 mrs x0, CNTVCT_EL0 21#endif 22 ret 23.size _armv7_tick,.-_armv7_tick 24 25.globl _armv8_aes_probe 26.type _armv8_aes_probe,%function 27_armv8_aes_probe: 28 aese v0.16b, v0.16b 29 ret 30.size _armv8_aes_probe,.-_armv8_aes_probe 31 32.globl _armv8_sha1_probe 33.type _armv8_sha1_probe,%function 34_armv8_sha1_probe: 35 sha1h s0, s0 36 ret 37.size _armv8_sha1_probe,.-_armv8_sha1_probe 38 39.globl _armv8_sha256_probe 40.type _armv8_sha256_probe,%function 41_armv8_sha256_probe: 42 sha256su0 v0.4s, v0.4s 43 ret 44.size _armv8_sha256_probe,.-_armv8_sha256_probe 45.globl _armv8_pmull_probe 46.type _armv8_pmull_probe,%function 47_armv8_pmull_probe: 48 pmull v0.1q, v0.1d, v0.1d 49 ret 50.size _armv8_pmull_probe,.-_armv8_pmull_probe 51 52.globl OPENSSL_cleanse 53.type OPENSSL_cleanse,%function 54.align 5 55OPENSSL_cleanse: 56 cbz x1,.Lret // len==0? 57 cmp x1,#15 58 b.hi .Lot // len>15 59 nop 60.Little: 61 strb wzr,[x0],#1 // store byte-by-byte 62 subs x1,x1,#1 63 b.ne .Little 64.Lret: ret 65 66.align 4 67.Lot: tst x0,#7 68 b.eq .Laligned // inp is aligned 69 strb wzr,[x0],#1 // store byte-by-byte 70 sub x1,x1,#1 71 b .Lot 72 73.align 4 74.Laligned: 75 str xzr,[x0],#8 // store word-by-word 76 sub x1,x1,#8 77 tst x1,#-8 78 b.ne .Laligned // len>=8 79 cbnz x1,.Little // len!=0? 80 ret 81.size OPENSSL_cleanse,.-OPENSSL_cleanse 82 83.globl CRYPTO_memcmp 84.type CRYPTO_memcmp,%function 85.align 4 86CRYPTO_memcmp: 87 eor w3,w3,w3 88 cbz x2,.Lno_data // len==0? 89.Loop_cmp: 90 ldrb w4,[x0],#1 91 ldrb w5,[x1],#1 92 eor w4,w4,w5 93 orr w3,w3,w4 94 subs x2,x2,#1 95 b.ne .Loop_cmp 96 97.Lno_data: 98 neg w0,w3 99 lsr w0,w0,#31 100 ret 101.size CRYPTO_memcmp,.-CRYPTO_memcmp 102