Fix no-posix-io compile failure
[openssl.git] / crypto / perlasm / sparcv9_modes.pl
index 81e602671b38208c00b537cdd72f7c68dd22d165..b9922e031893cd38cd1df805ab32b6aa12a483f0 100644 (file)
@@ -1,4 +1,11 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2012-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
+
 
 # Specific modes implementations for SPARC Architecture 2011. There
 # is T4 dependency though, an ASI value that is not specified in the
@@ -41,6 +48,7 @@ ${alg}${bits}_t4_cbc_encrypt:
        save            %sp, -$::frame, %sp
        cmp             $len, 0
        be,pn           $::size_t_cc, .L${bits}_cbc_enc_abort
+       srln            $len, 0, $len           ! needed on v8+, "nop" on v9
        sub             $inp, $out, $blk_init   ! $inp!=$out
 ___
 $::code.=<<___ if (!$::evp);
@@ -109,7 +117,7 @@ $::code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 1, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        brnz,pt         $len, .L${bits}_cbc_enc_loop
@@ -216,7 +224,7 @@ $::code.=<<___;
        call            _${alg}${bits}_encrypt_1x
        add             $inp, 16, $inp
        sub             $len, 1, $len
-               
+
        stda            %f0, [$out]0xe2         ! ASI_BLK_INIT, T4-specific
        add             $out, 8, $out
        stda            %f2, [$out]0xe2         ! ASI_BLK_INIT, T4-specific
@@ -258,6 +266,7 @@ ${alg}${bits}_t4_cbc_decrypt:
        save            %sp, -$::frame, %sp
        cmp             $len, 0
        be,pn           $::size_t_cc, .L${bits}_cbc_dec_abort
+       srln            $len, 0, $len           ! needed on v8+, "nop" on v9
        sub             $inp, $out, $blk_init   ! $inp!=$out
 ___
 $::code.=<<___ if (!$::evp);
@@ -330,7 +339,7 @@ $::code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 1, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        brnz,pt         $len, .L${bits}_cbc_dec_loop2x
@@ -436,7 +445,7 @@ $::code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 2, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        std             %f4, [$out + 16]
@@ -617,6 +626,7 @@ $::code.=<<___;
 .align 32
 ${alg}${bits}_t4_ctr32_encrypt:
        save            %sp, -$::frame, %sp
+       srln            $len, 0, $len           ! needed on v8+, "nop" on v9
 
        prefetch        [$inp], 20
        prefetch        [$inp + 63], 20
@@ -692,7 +702,7 @@ $::code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 1, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        brnz,pt         $len, .L${bits}_ctr32_loop2x
@@ -781,7 +791,7 @@ $::code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 2, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        std             %f4, [$out + 16]
@@ -920,6 +930,7 @@ $::code.=<<___;
 .align 32
 ${alg}${bits}_t4_xts_${dir}crypt:
        save            %sp, -$::frame-16, %sp
+       srln            $len, 0, $len           ! needed on v8+, "nop" on v9
 
        mov             $ivec, %o0
        add             %fp, $::bias-16, %o1
@@ -1013,7 +1024,7 @@ $code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 1, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        brnz,pt         $len, .L${bits}_xts_${dir}loop2x
@@ -1124,7 +1135,7 @@ $code.=<<___;
 
        brnz,pn         $ooff, 2f
        sub             $len, 2, $len
-               
+
        std             %f0, [$out + 0]
        std             %f2, [$out + 8]
        std             %f4, [$out + 16]