s390x assembler update: add support for run-time facility detection [from HEAD].
[openssl.git] / crypto / sha / asm / sha1-s390x.pl
index eb6f8df..4b17848 100644 (file)
@@ -143,6 +143,10 @@ Ktable: .long      0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6
 sha1_block_data_order:
 ___
 $code.=<<___ if ($kimdfunc);
+       larl    %r1,OPENSSL_s390xcap_P
+       lg      %r0,0(%r1)
+       tmhl    %r0,0x4000      # check for message-security assist
+       jz      .Lsoftware
        lghi    %r0,0
        la      %r1,16($sp)
        .long   0xb93e0002      # kimd %r0,%r2
@@ -213,6 +217,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,8,8
 ___
 
 $code =~ s/\`([^\`]*)\`/eval $1/gem;