X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Farmv4cpuid.pl;h=ab007c19c3cd0c2caf9e16e50649cc4b76df8ae1;hb=f408e2a352b59f2e7aa2160bfb6285725fe88ea7;hp=2c02f08c74cc6a77eb6d90ca1664b9988073a4f7;hpb=e0a651945cb5a70a2abd9902c0fd3e9759d35867;p=oweals%2Fopenssl.git diff --git a/crypto/armv4cpuid.pl b/crypto/armv4cpuid.pl index 2c02f08c74..ab007c19c3 100644 --- a/crypto/armv4cpuid.pl +++ b/crypto/armv4cpuid.pl @@ -1,5 +1,5 @@ #! /usr/bin/env perl -# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -27,6 +27,7 @@ $code.=<<___; .thumb #else .code 32 +#undef __thumb2__ #endif .align 5 @@ -105,6 +106,36 @@ OPENSSL_cleanse: #endif .size OPENSSL_cleanse,.-OPENSSL_cleanse +.global CRYPTO_memcmp +.type CRYPTO_memcmp,%function +.align 4 +CRYPTO_memcmp: + eor ip,ip,ip + cmp r2,#0 + beq .Lno_data + stmdb sp!,{r4,r5} + +.Loop_cmp: + ldrb r4,[r0],#1 + ldrb r5,[r1],#1 + eor r4,r4,r5 + orr ip,ip,r4 + subs r2,r2,#1 + bne .Loop_cmp + + ldmia sp!,{r4,r5} +.Lno_data: + rsb r0,ip,#0 + mov r0,r0,lsr#31 +#if __ARM_ARCH__>=5 + bx lr +#else + tst lr,#1 + moveq pc,lr + .word 0xe12fff1e @ bx lr +#endif +.size CRYPTO_memcmp,.-CRYPTO_memcmp + #if __ARM_MAX_ARCH__>=7 .arch armv7-a .fpu neon