ARMv4 assembly pack: allow Thumb2 even in iOS build,
authorAndy Polyakov <appro@openssl.org>
Sun, 6 Dec 2015 21:02:39 +0000 (22:02 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 7 Dec 2015 11:06:06 +0000 (12:06 +0100)
and engage it in most modules.

Reviewed-by: Tim Hudson <tjh@openssl.org>
crypto/aes/asm/aes-armv4.pl
crypto/aes/asm/bsaes-armv7.pl
crypto/bn/asm/armv4-gf2m.pl
crypto/bn/asm/armv4-mont.pl
crypto/ec/asm/ecp_nistz256-armv4.pl
crypto/modes/asm/ghash-armv4.pl
crypto/perlasm/arm-xlate.pl
crypto/sha/asm/sha1-armv4-large.pl
crypto/sha/asm/sha256-armv4.pl
crypto/sha/asm/sha512-armv4.pl

index c3d166ff5f94d445a120545d3b4cb0dec525c2ce..fbe45975a5b9965f2e93ec209be6d68eb7a793f9 100644 (file)
@@ -75,6 +75,7 @@ $code=<<___;
 .thumb
 #else
 .code  32
 .thumb
 #else
 .code  32
+#undef __thumb2__
 #endif
 
 .type  AES_Te,%object
 #endif
 
 .type  AES_Te,%object
index f9293d599bc44393715ed3b718bdacdd10d48182..03b8d825cd5f5f6ed6e01457173692f0b3e2d1bc 100644 (file)
@@ -731,6 +731,7 @@ $code.=<<___;
 .thumb
 #else
 .code   32
 .thumb
 #else
 .code   32
+# undef __thumb2__
 #endif
 
 .type  _bsaes_decrypt8,%function
 #endif
 
 .type  _bsaes_decrypt8,%function
index 227581e10c7fed7e1f9aac97f3fe31bd2350d384..22aa4830f8edcee997589b1528e52412ec6b3105 100644 (file)
@@ -51,7 +51,7 @@ $code=<<___;
 #include "arm_arch.h"
 
 .text
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax        unified
 .thumb
 #else
 .syntax        unified
 .thumb
 #else
index 48e523013fe4523d9a9feac649dc6b491f5cdc4f..7017ad5f20eb94af5d963046dfe923fe48600125 100644 (file)
@@ -91,7 +91,7 @@ $code=<<___;
 #include "arm_arch.h"
 
 .text
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax        unified
 .thumb
 #else
 .syntax        unified
 .thumb
 #else
index aeeb190335f9ae2f8f57b56b57cd4fe88fa7ff80..3a636eae6cb61d8ab7830c6b7770db4d4e7d619f 100755 (executable)
@@ -45,7 +45,7 @@ $code.=<<___;
 #include "arm_arch.h"
 
 .text
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax        unified
 .thumb
 #else
 .syntax        unified
 .thumb
 #else
index 245ac921d298cbbbd219354b39f7c8fd3d84e6a6..0d5b8ef3a76e08e91caf5cd6569c8872ad09bc81 100644 (file)
@@ -136,7 +136,7 @@ $code=<<___;
 #include "arm_arch.h"
 
 .text
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax        unified
 .thumb
 #else
 .syntax        unified
 .thumb
 #else
index 81ceb3142ce377eb7ea77376a170ca899de6415d..ecd3198c44db7ca340c5d31b7240243e7bccabd9 100755 (executable)
@@ -66,6 +66,12 @@ my $extern = sub {
 };
 my $type = sub {
     if ($flavour =~ /linux/)   { ".type\t".join(',',@_); }
 };
 my $type = sub {
     if ($flavour =~ /linux/)   { ".type\t".join(',',@_); }
+    elsif ($flavour =~ /ios32/)        { if (join(',',@_) =~ /(\w+),%function/) {
+                                       "#ifdef __thumb2__\n".
+                                       ".thumb_func    $1\n".
+                                       "#endif";
+                                 }
+                               }
     else                       { ""; }
 };
 my $size = sub {
     else                       { ""; }
 };
 my $size = sub {
index 9d34e04f7b632d25b146ce16f49be87fa3bb6829..e1bb92bad764dd26c9ca9a60819d2804f152a034 100644 (file)
@@ -181,7 +181,7 @@ $code=<<___;
 #include "arm_arch.h"
 
 .text
 #include "arm_arch.h"
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax        unified
 .thumb
 #else
 .syntax        unified
 .thumb
 #else
@@ -222,7 +222,7 @@ for($i=0;$i<5;$i++) {
        &BODY_00_15(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
        &BODY_00_15(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
        mov     $t3,sp
        teq     $Xi,$t3
 #else
        mov     $t3,sp
        teq     $Xi,$t3
 #else
@@ -246,7 +246,7 @@ for($i=0;$i<5;$i++) {
        &BODY_20_39(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
        &BODY_20_39(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
        mov     $t3,sp
        teq     $Xi,$t3
 #else
        mov     $t3,sp
        teq     $Xi,$t3
 #else
@@ -263,7 +263,7 @@ for($i=0;$i<5;$i++) {
        &BODY_40_59(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
        &BODY_40_59(@V);        unshift(@V,pop(@V));
 }
 $code.=<<___;
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
        mov     $t3,sp
        teq     $Xi,$t3
 #else
        mov     $t3,sp
        teq     $Xi,$t3
 #else
@@ -610,7 +610,7 @@ my ($W0,$W1,$ABCD_SAVE)=map("q$_",(12..14));
 $code.=<<___;
 #if __ARM_MAX_ARCH__>=7
 
 $code.=<<___;
 #if __ARM_MAX_ARCH__>=7
 
-# if defined(__thumb2__) && !defined(__APPLE__)
+# if defined(__thumb2__)
 #  define INST(a,b,c,d)        .byte   c,d|0xf,a,b
 # else
 #  define INST(a,b,c,d)        .byte   a,b,c,d|0x10
 #  define INST(a,b,c,d)        .byte   c,d|0xf,a,b
 # else
 #  define INST(a,b,c,d)        .byte   a,b,c,d|0x10
index c65073b7f95c1f6f6cd1badcaf75192122e9e29a..b6b39dcbbb3f73bc9b9da3030e3693c872da114c 100644 (file)
@@ -175,7 +175,7 @@ $code=<<___;
 #endif
 
 .text
 #endif
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax unified
 .thumb
 # define adrl adr
 .syntax unified
 .thumb
 # define adrl adr
@@ -595,7 +595,7 @@ my $Ktbl="r3";
 $code.=<<___;
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 
 $code.=<<___;
 #if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
 
-# if defined(__thumb2__) && !defined(__APPLE__)
+# if defined(__thumb2__)
 #  define INST(a,b,c,d)        .byte   c,d|0xc,a,b
 # else
 #  define INST(a,b,c,d)        .byte   a,b,c,d
 #  define INST(a,b,c,d)        .byte   c,d|0xc,a,b
 # else
 #  define INST(a,b,c,d)        .byte   a,b,c,d
index a83d6772c8d357c71523196ffc8c559363c0fc20..56bb9fddffc7965e5335d0d3c0fa651fa7f99cf6 100644 (file)
@@ -212,7 +212,7 @@ $code=<<___;
 #endif
 
 .text
 #endif
 
 .text
-#if defined(__thumb2__) && !defined(__APPLE__)
+#if defined(__thumb2__)
 .syntax unified
 .thumb
 # define adrl adr
 .syntax unified
 .thumb
 # define adrl adr