sha/asm/keccak1600-avx512.pl: absorb bug-fix and minor optimization.
[oweals/openssl.git] / crypto / sha / asm / sha512-s390x.pl
index 160997e31d478c63f12ef8b8e4d6cafed2f7e6a6..92d7a7725a67313480078ccb39b066ff4a4b0068 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
@@ -64,7 +71,7 @@ $tbl="%r13";
 $T1="%r14";
 $sp="%r15";
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 if ($output =~ /512/) {
@@ -240,10 +247,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
@@ -307,11 +311,11 @@ $code.=<<___;
        cl${g}  $inp,`$frame+4*$SIZE_T`($sp)
        jne     .Lloop
 
-       lm${g}  %r6,%r15,`$frame+6*$SIZE_T`($sp)        
+       lm${g}  %r6,%r15,`$frame+6*$SIZE_T`($sp)
        br      %r14
 .size  $Func,.-$Func
 .string        "SHA${label} 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;