sha[256|512]-586.pl: add more SIMD code paths.
[openssl.git] / crypto / sha / asm / sha1-sparcv9.pl
index f661e96524eb2b1f77bc6cd376917d14fd6b79ed..b5efcde5c13962f37c0a7aad65269969759154c0 100644 (file)
 # single-process result on 8-core processor, or ~9GBps per 2.85GHz
 # socket.
 
-$bits=32;
-for (@ARGV)    { $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
-if ($bits==64) { $bias=2047; $frame=192; }
-else           { $bias=0;    $frame=112; }
-
 $output=shift;
 open STDOUT,">$output";
 
@@ -185,13 +180,14 @@ $code.=<<___;
 ___
 }
 
-$code.=<<___ if ($bits==64);
-.register      %g2,#scratch
-.register      %g3,#scratch
-___
 $code.=<<___;
 #include "sparc_arch.h"
 
+#ifdef __arch64__
+.register      %g2,#scratch
+.register      %g3,#scratch
+#endif
+
 .section       ".text",#alloc,#execinstr
 
 #ifdef __PIC__
@@ -227,10 +223,11 @@ sha1_block_data_order:
        subcc   %o2, 1, %o2             ! done yet? 
        ldd     [%o1 + 0x38], %f22
        add     %o1, 0x40, %o1
+       prefetch [%o1 + 63], 20
 
        .word   0x81b02820              ! SHA1
 
-       bne,pt  `$bits==64?"%xcc":"%icc"`, .Lhw_loop
+       bne,pt  SIZE_T_CC, .Lhw_loop
        nop
 
 .Lhwfinish:
@@ -257,6 +254,7 @@ sha1_block_data_order:
        subcc   %o2, 1, %o2             ! done yet?
        ldd     [%o1 + 0x40], %f26
        add     %o1, 0x40, %o1
+       prefetch [%o1 + 63], 20
 
        faligndata %f10, %f12, %f8
        faligndata %f12, %f14, %f10
@@ -269,7 +267,7 @@ sha1_block_data_order:
 
        .word   0x81b02820              ! SHA1
 
-       bne,pt  `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop
+       bne,pt  SIZE_T_CC, .Lhwunaligned_loop
        for     %f26, %f26, %f10        ! %f10=%f26
 
        ba      .Lhwfinish
@@ -277,7 +275,7 @@ sha1_block_data_order:
 
 .align 16
 .Lsoftware:
-       save    %sp,-$frame,%sp
+       save    %sp,-STACK_FRAME,%sp
        sllx    $len,6,$len
        add     $inp,$len,$len
 
@@ -357,7 +355,7 @@ $code.=<<___;
        add     $E,@X[4],$E
        st      $E,[$ctx+16]
 
-       bne     `$bits==64?"%xcc":"%icc"`,.Lloop
+       bne     SIZE_T_CC,.Lloop
        andn    $inp,7,$tmp0
 
        ret