Consistently use arm_arch.h constants in armcap assembly code.
authorDavid Benjamin <davidben@google.com>
Tue, 23 Feb 2016 16:41:55 +0000 (11:41 -0500)
committerAndy Polyakov <appro@openssl.org>
Wed, 2 Mar 2016 11:57:28 +0000 (12:57 +0100)
Most of the assembly uses constants from arm_arch.h, but a few references to
ARMV7_NEON don't. Consistently use the macros everywhere.

Signed-off-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bn/asm/armv4-mont.pl
crypto/chacha/asm/chacha-armv4.pl
crypto/poly1305/asm/poly1305-armv4.pl
crypto/sha/asm/sha512-armv4.pl

index 7017ad5f20eb94af5d963046dfe923fe48600125..6fb5bb40fb5c9bdec33e10bd0690f10028c09849 100644 (file)
@@ -121,7 +121,7 @@ bn_mul_mont:
 #ifdef __APPLE__
        ldr     r0,[r0]
 #endif
 #ifdef __APPLE__
        ldr     r0,[r0]
 #endif
-       tst     r0,#1                   @ NEON available?
+       tst     r0,#ARMV7_NEON          @ NEON available?
        ldmia   sp, {r0,r2}
        beq     .Lialu
        add     sp,sp,#8
        ldmia   sp, {r0,r2}
        beq     .Lialu
        add     sp,sp,#8
index 6c207557a5066ad094adec796458c3bf6202004d..4545101c3103a54a00b91b3ae578dad2f527de60 100755 (executable)
@@ -214,7 +214,7 @@ ChaCha20_ctr32:
 # ifdef        __APPLE__
        ldr     r4,[r4]
 # endif
 # ifdef        __APPLE__
        ldr     r4,[r4]
 # endif
-       tst     r4,#1
+       tst     r4,#ARMV7_NEON
        bne     .LChaCha20_neon
 .Lshort:
 #endif
        bne     .LChaCha20_neon
 .Lshort:
 #endif
index 65b79cf124d7f27568432ff544ef960eebfff9c2..86a6070bf46ecac9747cc67f726b48ca675bc611 100755 (executable)
@@ -108,7 +108,7 @@ poly1305_init:
        and     r5,r5,r3
 
 #if    __ARM_MAX_ARCH__>=7
        and     r5,r5,r3
 
 #if    __ARM_MAX_ARCH__>=7
-       tst     r12,#1                  @ check for NEON
+       tst     r12,#ARMV7_NEON         @ check for NEON
 # ifdef        __APPLE__
        adr     r9,poly1305_blocks_neon
        adr     r11,poly1305_blocks
 # ifdef        __APPLE__
        adr     r9,poly1305_blocks_neon
        adr     r11,poly1305_blocks
index 56bb9fddffc7965e5335d0d3c0fa651fa7f99cf6..9e3c4dbf1c1d8c177ee5dc73cede00c79c0a85e4 100644 (file)
@@ -287,7 +287,7 @@ sha512_block_data_order:
 #ifdef __APPLE__
        ldr     r12,[r12]
 #endif
 #ifdef __APPLE__
        ldr     r12,[r12]
 #endif
-       tst     r12,#1
+       tst     r12,#ARMV7_NEON
        bne     .LNEON
 #endif
        add     $len,$inp,$len,lsl#7    @ len to point at the end of inp
        bne     .LNEON
 #endif
        add     $len,$inp,$len,lsl#7    @ len to point at the end of inp