SPARC assembly pack: enforce V8+ ABI constraints.
[openssl.git] / crypto / poly1305 / asm / poly1305-sparcv9.pl
index 460c863748fd3d564813341b09cc46e4c2bda8a9..0bdd04892544a0787d6c58a62451a1792e9f9486 100755 (executable)
@@ -139,13 +139,14 @@ poly1305_init:
 .Lno_key:
        ret
        restore %g0,%g0,%o0             ! return 0
+.type  poly1305_init,#function
 .size  poly1305_init,.-poly1305_init
 
 .globl poly1305_blocks
 .align 32
 poly1305_blocks:
        save    %sp,-STACK_FRAME,%sp
-       andn    $len,15,$len
+       srln    $len,4,$len
 
        brz,pn  $len,.Lno_data
        nop
@@ -201,7 +202,7 @@ poly1305_blocks:
        umul    $r1,$h0,$d1
        umul    $r2,$h0,$d2
        umul    $r3,$h0,$d3
-        sub    $len,16,$len
+        sub    $len,1,$len
         add    $inp,16,$inp
 
        umul    $s3,$h1,$t0
@@ -271,6 +272,7 @@ poly1305_blocks:
 .Lno_data:
        ret
        restore
+.type  poly1305_blocks,#function
 .size  poly1305_blocks,.-poly1305_blocks
 ___
 ########################################################################
@@ -283,7 +285,7 @@ $code.=<<___;
 .align 32
 poly1305_blocks_vis3:
        save    %sp,-STACK_FRAME,%sp
-       andn    $len,15,$len
+       srln    $len,4,$len
 
        brz,pn  $len,.Lno_data
        nop
@@ -321,7 +323,7 @@ poly1305_blocks_vis3:
 
 .Linp_aligned_vis3:
        addcc   $D0,$H0,$H0             ! accumulate input
-        sub    $len,16,$len
+        sub    $len,1,$len
        addxccc $D1,$H1,$H1
         add    $inp,16,$inp
 
@@ -361,6 +363,7 @@ poly1305_blocks_vis3:
 
        ret
        restore
+.type  poly1305_blocks_vis3,#function
 .size  poly1305_blocks_vis3,.-poly1305_blocks_vis3
 ___
 }
@@ -433,6 +436,7 @@ poly1305_emit:
 
        ret
        restore
+.type  poly1305_emit,#function
 .size  poly1305_emit,.-poly1305_emit
 ___
 
@@ -598,12 +602,13 @@ poly1305_init_fma:
 .Lno_key_fma:
        ret
        restore %g0,%g0,%o0                     ! return 0
+.type  poly1305_init_fma,#function
 .size  poly1305_init_fma,.-poly1305_init_fma
 
 .align 32
 poly1305_blocks_fma:
        save    %sp,-STACK_FRAME-48,%sp
-       srlx    $len,4,$len
+       srln    $len,4,$len
 
        brz,pn  $len,.Labort
        sub     $len,1,$len
@@ -905,6 +910,7 @@ poly1305_blocks_fma:
 .Labort:
        ret
        restore
+.type  poly1305_blocks_fma,#function
 .size  poly1305_blocks_fma,.-poly1305_blocks_fma
 ___
 {
@@ -1011,6 +1017,7 @@ poly1305_emit_fma:
 
        ret
        restore
+.type  poly1305_emit_fma,#function
 .size  poly1305_emit_fma,.-poly1305_emit_fma
 ___
 }