Path: blob/main/sys/crypto/openssl/aarch64/arm64cpuid.S
39536 views
/* Do not modify. This file is auto-generated from arm64cpuid.pl. */1#include "arm_arch.h"23.text4.arch armv8-a+crypto56.align 57.globl _armv7_neon_probe8.type _armv7_neon_probe,%function9_armv7_neon_probe:10AARCH64_VALID_CALL_TARGET11orr v15.16b, v15.16b, v15.16b12ret13.size _armv7_neon_probe,.-_armv7_neon_probe1415.globl _armv7_tick16.type _armv7_tick,%function17_armv7_tick:18AARCH64_VALID_CALL_TARGET19#ifdef __APPLE__20mrs x0, CNTPCT_EL021#else22mrs x0, CNTVCT_EL023#endif24ret25.size _armv7_tick,.-_armv7_tick2627.globl _armv8_aes_probe28.type _armv8_aes_probe,%function29_armv8_aes_probe:30AARCH64_VALID_CALL_TARGET31aese v0.16b, v0.16b32ret33.size _armv8_aes_probe,.-_armv8_aes_probe3435.globl _armv8_sha1_probe36.type _armv8_sha1_probe,%function37_armv8_sha1_probe:38AARCH64_VALID_CALL_TARGET39sha1h s0, s040ret41.size _armv8_sha1_probe,.-_armv8_sha1_probe4243.globl _armv8_sha256_probe44.type _armv8_sha256_probe,%function45_armv8_sha256_probe:46AARCH64_VALID_CALL_TARGET47sha256su0 v0.4s, v0.4s48ret49.size _armv8_sha256_probe,.-_armv8_sha256_probe5051.globl _armv8_pmull_probe52.type _armv8_pmull_probe,%function53_armv8_pmull_probe:54AARCH64_VALID_CALL_TARGET55pmull v0.1q, v0.1d, v0.1d56ret57.size _armv8_pmull_probe,.-_armv8_pmull_probe5859.globl _armv8_sm4_probe60.type _armv8_sm4_probe,%function61_armv8_sm4_probe:62AARCH64_VALID_CALL_TARGET63.inst 0xcec08400 // sm4e v0.4s, v0.4s64ret65.size _armv8_sm4_probe,.-_armv8_sm4_probe6667.globl _armv8_sha512_probe68.type _armv8_sha512_probe,%function69_armv8_sha512_probe:70AARCH64_VALID_CALL_TARGET71.inst 0xcec08000 // sha512su0 v0.2d,v0.2d72ret73.size _armv8_sha512_probe,.-_armv8_sha512_probe7475.globl _armv8_eor3_probe76.type _armv8_eor3_probe,%function77_armv8_eor3_probe:78AARCH64_VALID_CALL_TARGET79.inst 0xce010800 // eor3 v0.16b, v0.16b, v1.16b, v2.16b80ret81.size _armv8_eor3_probe,.-_armv8_eor3_probe8283.globl _armv8_sve_probe84.type _armv8_sve_probe,%function85_armv8_sve_probe:86AARCH64_VALID_CALL_TARGET87.inst 0x04a03000 // eor z0.d,z0.d,z0.d88ret89.size _armv8_sve_probe,.-_armv8_sve_probe9091.globl _armv8_sve2_probe92.type _armv8_sve2_probe,%function93_armv8_sve2_probe:94AARCH64_VALID_CALL_TARGET95.inst 0x04e03400 // xar z0.d,z0.d,z0.d96ret97.size _armv8_sve2_probe,.-_armv8_sve2_probe9899.globl _armv8_cpuid_probe100.type _armv8_cpuid_probe,%function101_armv8_cpuid_probe:102AARCH64_VALID_CALL_TARGET103mrs x0, midr_el1104ret105.size _armv8_cpuid_probe,.-_armv8_cpuid_probe106107.globl _armv8_sm3_probe108.type _armv8_sm3_probe,%function109_armv8_sm3_probe:110AARCH64_VALID_CALL_TARGET111.inst 0xce63c004 // sm3partw1 v4.4s, v0.4s, v3.4s112ret113.size _armv8_sm3_probe,.-_armv8_sm3_probe114115.globl OPENSSL_cleanse116.type OPENSSL_cleanse,%function117.align 5118OPENSSL_cleanse:119AARCH64_VALID_CALL_TARGET120cbz x1,.Lret // len==0?121cmp x1,#15122b.hi .Lot // len>15123nop124.Little:125strb wzr,[x0],#1 // store byte-by-byte126subs x1,x1,#1127b.ne .Little128.Lret: ret129130.align 4131.Lot: tst x0,#7132b.eq .Laligned // inp is aligned133strb wzr,[x0],#1 // store byte-by-byte134sub x1,x1,#1135b .Lot136137.align 4138.Laligned:139str xzr,[x0],#8 // store word-by-word140sub x1,x1,#8141tst x1,#-8142b.ne .Laligned // len>=8143cbnz x1,.Little // len!=0?144ret145.size OPENSSL_cleanse,.-OPENSSL_cleanse146147.globl CRYPTO_memcmp148.type CRYPTO_memcmp,%function149.align 4150CRYPTO_memcmp:151AARCH64_VALID_CALL_TARGET152eor w3,w3,w3153cbz x2,.Lno_data // len==0?154cmp x2,#16155b.ne .Loop_cmp156ldp x8,x9,[x0]157ldp x10,x11,[x1]158eor x8,x8,x10159eor x9,x9,x11160orr x8,x8,x9161mov x0,#1162cmp x8,#0163csel x0,xzr,x0,eq164ret165166.align 4167.Loop_cmp:168ldrb w4,[x0],#1169ldrb w5,[x1],#1170eor w4,w4,w5171orr w3,w3,w4172subs x2,x2,#1173b.ne .Loop_cmp174175.Lno_data:176neg w0,w3177lsr w0,w0,#31178ret179.size CRYPTO_memcmp,.-CRYPTO_memcmp180181.globl _armv8_rng_probe182.type _armv8_rng_probe,%function183_armv8_rng_probe:184AARCH64_VALID_CALL_TARGET185mrs x0, s3_3_c2_c4_0 // rndr186mrs x0, s3_3_c2_c4_1 // rndrrs187ret188.size _armv8_rng_probe,.-_armv8_rng_probe189// Fill buffer with Randomly Generated Bytes190// inputs: char * in x0 - Pointer to buffer191// size_t in x1 - Number of bytes to write to buffer192// outputs: size_t in x0 - Number of bytes successfully written to buffer193.globl OPENSSL_rndr_asm194.type OPENSSL_rndr_asm,%function195.align 4196OPENSSL_rndr_asm:197AARCH64_VALID_CALL_TARGET198mov x2,xzr199mov x3,xzr200201.align 4202.Loop_rndr:203cmp x1,#0204b.eq .rndr_done205mov x3,xzr206mrs x3,s3_3_c2_c4_0207b.eq .rndr_done208209cmp x1,#8210b.lt .Loop_single_byte_rndr211212str x3,[x0]213add x0,x0,#8214add x2,x2,#8215subs x1,x1,#8216b.ge .Loop_rndr217218.align 4219.Loop_single_byte_rndr:220strb w3,[x0]221lsr x3,x3,#8222add x2,x2,#1223add x0,x0,#1224subs x1,x1,#1225b.gt .Loop_single_byte_rndr226227.align 4228.rndr_done:229mov x0,x2230ret231.size OPENSSL_rndr_asm,.-OPENSSL_rndr_asm232// Fill buffer with Randomly Generated Bytes233// inputs: char * in x0 - Pointer to buffer234// size_t in x1 - Number of bytes to write to buffer235// outputs: size_t in x0 - Number of bytes successfully written to buffer236.globl OPENSSL_rndrrs_asm237.type OPENSSL_rndrrs_asm,%function238.align 4239OPENSSL_rndrrs_asm:240AARCH64_VALID_CALL_TARGET241mov x2,xzr242mov x3,xzr243244.align 4245.Loop_rndrrs:246cmp x1,#0247b.eq .rndrrs_done248mov x3,xzr249mrs x3,s3_3_c2_c4_1250b.eq .rndrrs_done251252cmp x1,#8253b.lt .Loop_single_byte_rndrrs254255str x3,[x0]256add x0,x0,#8257add x2,x2,#8258subs x1,x1,#8259b.ge .Loop_rndrrs260261.align 4262.Loop_single_byte_rndrrs:263strb w3,[x0]264lsr x3,x3,#8265add x2,x2,#1266add x0,x0,#1267subs x1,x1,#1268b.gt .Loop_single_byte_rndrrs269270.align 4271.rndrrs_done:272mov x0,x2273ret274.size OPENSSL_rndrrs_asm,.-OPENSSL_rndrrs_asm275276277