sha/asm/keccak1600-x86_64.pl: add CFI directives.
[openssl.git] / crypto / sha / asm / sha1-armv8.pl
index c1f552b6b3d6de78f6b9eea68087754234f07e4f..84a00bf2afe80b04f5f6e96d16cbba19a7784594 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2014-2016 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
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 #
 # ====================================================================
 # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
 #
 #              hardware-assisted       software(*)
 # Apple A7     2.31                    4.13 (+14%)
-# Cortex-A5x   n/a                     n/a
+# Cortex-A53   2.24                    8.03 (+97%)
+# Cortex-A57   2.35                    7.88 (+74%)
+# Denver       2.13                    3.97 (+0%)(**)
+# X-Gene                               8.80 (+200%)
+# Mongoose     2.05                    6.50 (+160%)
 #
 # (*)  Software results are presented mostly for reference purposes.
+# (**) Keep in mind that Denver relies on binary translation, which
+#      optimizes compiler output at run-time.
 
 $flavour = shift;
-open STDOUT,">".shift;
+$output  = shift;
+
+$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+die "can't locate arm-xlate.pl";
+
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 ($ctx,$inp,$num)=("x0","x1","x2");
 @Xw=map("w$_",(3..17,19));
@@ -153,11 +174,16 @@ $code.=<<___;
 
 .text
 
+.extern        OPENSSL_armcap_P
 .globl sha1_block_data_order
 .type  sha1_block_data_order,%function
 .align 6
 sha1_block_data_order:
+#ifdef __ILP32__
+       ldrsw   x16,.LOPENSSL_armcap_P
+#else
        ldr     x16,.LOPENSSL_armcap_P
+#endif
        adr     x17,.LOPENSSL_armcap_P
        add     x16,x16,x17
        ldr     w16,[x16]
@@ -295,7 +321,11 @@ $code.=<<___;
 .long  0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc     //K_40_59
 .long  0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6     //K_60_79
 .LOPENSSL_armcap_P:
+#ifdef __ILP32__
+.long  OPENSSL_armcap_P-.
+#else
 .quad  OPENSSL_armcap_P-.
+#endif
 .asciz "SHA1 block transform for ARMv8, CRYPTOGAMS by <appro\@openssl.org>"
 .align 2
 .comm  OPENSSL_armcap_P,4,4