diff options
author | Andy Polyakov <appro@openssl.org> | 2014-06-06 21:27:18 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2014-06-06 21:27:18 +0200 |
commit | 5dcf70a1c57c2019bfad640fe14fd4a73212860a (patch) | |
tree | 0033ec72c6c8080843ceda81aa0a3b37be5f8342 /crypto/bn/asm/armv4-mont.pl | |
parent | cd91fd7c32428c0deb503f19b8061e0980476876 (diff) |
ARM assembly pack: get ARMv7 instruction endianness right.
Pointer out and suggested by: Ard Biesheuvel.
Diffstat (limited to 'crypto/bn/asm/armv4-mont.pl')
-rw-r--r-- | crypto/bn/asm/armv4-mont.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/bn/asm/armv4-mont.pl b/crypto/bn/asm/armv4-mont.pl index fe81f9b6f6..72bad8e308 100644 --- a/crypto/bn/asm/armv4-mont.pl +++ b/crypto/bn/asm/armv4-mont.pl @@ -230,9 +230,14 @@ bn_mul_mont: ldmia sp!,{r4-r12,lr} @ restore registers add sp,sp,#2*4 @ skip over {r0,r2} mov r0,#1 -.Labrt: tst lr,#1 +.Labrt: +#if __ARM_ARCH__>=5 + ret @ bx lr +#else + tst lr,#1 moveq pc,lr @ be binary compatible with V4, yet bx lr @ interoperable with Thumb ISA:-) +#endif .size bn_mul_mont,.-bn_mul_mont ___ { @@ -650,7 +655,7 @@ bn_mul8x_mont_neon: sub sp,ip,#96 vldmia sp!,{d8-d15} ldmia sp!,{r4-r11} - bx lr + ret @ bx lr .size bn_mul8x_mont_neon,.-bn_mul8x_mont_neon #endif ___ @@ -665,5 +670,6 @@ ___ $code =~ s/\`([^\`]*)\`/eval $1/gem; $code =~ s/\bbx\s+lr\b/.word\t0xe12fff1e/gm; # make it possible to compile with -march=armv4 +$code =~ s/\bret\b/bx lr/gm; print $code; close STDOUT; |