]> WPIA git - cassiopeia.git/blobdiff - lib/openssl/crypto/sha/asm/sha1-s390x.pl
upd: openssl to 1.1.0
[cassiopeia.git] / lib / openssl / crypto / sha / asm / sha1-s390x.pl
index 9193dda45eff974206f24a23480d27d604b8b4e6..b19606c5c514e2cfadf9751a89e3484117911185 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2007-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@fy.chalmers.se> for the OpenSSL
@@ -28,7 +35,8 @@
 # instructions and achieve "64-bit" performance even in 31-bit legacy
 # application context. The feature is not specific to any particular
 # processor, as long as it's "z-CPU". Latter implies that the code
-# remains z/Architecture specific.
+# remains z/Architecture specific. On z990 it was measured to perform
+# 23% better than code generated by gcc 4.3.
 
 $kimdfunc=1;   # magic function code for kimd instruction
 
@@ -42,7 +50,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $K_00_39="%r0"; $K=$K_00_39;
@@ -167,10 +175,7 @@ $code.=<<___ if ($kimdfunc);
        lg      %r0,0(%r1)
        tmhl    %r0,0x4000      # check for message-security assist
        jz      .Lsoftware
-       lghi    %r0,0
-       la      %r1,`2*$SIZE_T`($sp)
-       .long   0xb93e0002      # kimd %r0,%r2
-       lg      %r0,`2*$SIZE_T`($sp)
+       lg      %r0,16(%r1)     # check kimd capabilities
        tmhh    %r0,`0x8000>>$kimdfunc`
        jz      .Lsoftware
        lghi    %r0,$kimdfunc
@@ -237,7 +242,7 @@ $code.=<<___;
        br      %r14
 .size  sha1_block_data_order,.-sha1_block_data_order
 .string        "SHA1 block transform for s390x, CRYPTOGAMS by <appro\@openssl.org>"
-.comm  OPENSSL_s390xcap_P,16,8
+.comm  OPENSSL_s390xcap_P,80,8
 ___
 
 $code =~ s/\`([^\`]*)\`/eval $1/gem;