Update sha512-parisc.pl and add make rules.
authorAndy Polyakov <appro@openssl.org>
Sun, 27 Dec 2009 21:05:19 +0000 (21:05 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 27 Dec 2009 21:05:19 +0000 (21:05 +0000)
crypto/sha/Makefile
crypto/sha/asm/sha512-parisc.pl

index e6eccb05f9777d7848e52ee292129c743cb27a60..e7130b5ffb7c848e56a93703fc2d199da437223b 100644 (file)
@@ -71,6 +71,10 @@ sha1-ppc.s:  asm/sha1-ppc.pl;        $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
 sha256-ppc.s:  asm/sha512-ppc.pl;      $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
 sha512-ppc.s:  asm/sha512-ppc.pl;      $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
 
+sha1-parisc.s: asm/sha1-parisc.pl;     $(PERL) asm/sha1-parisc.pl $(PERLASM_SCHEME) $@
+sha256-parisc.s:asm/sha512-parisc.pl;  $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@
+sha512-parisc.s:asm/sha512-parisc.pl;  $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@
+
 # GNU make "catch all"
 sha1-%.s:      asm/sha1-%.pl;          $(PERL) $< $@
 sha256-%.s:    asm/sha512-%.pl;        $(PERL) $< $@
index da1282a0769008dd66b11a76bfcfc6f4fdebd595..9ccbdaaf82bc5f2cef71e06cf4a8c77354547db1 100755 (executable)
@@ -391,7 +391,7 @@ $code.=<<___;
        shd     $elo,$ehi,$Sigma1[0],$t1
         addc   $Xhi,$hhi,$hhi          ; h += X[i]
        shd     $ehi,$elo,$Sigma1[1],$t2
-        ldw,ma 8($Tbl),$Xhi
+        ldwm   8($Tbl),$Xhi
        shd     $elo,$ehi,$Sigma1[1],$t3
         ldw    -4($Tbl),$Xlo           ; load K[i]
        xor     $t2,$t0,$t0
@@ -694,9 +694,10 @@ my $ldd = sub {
   my ($mod,$args) = @_;
   my $orig = "ldd$mod\t$args";
 
-    if ($args =~ /([0-9]+)\(%r([0-9]+)\),%r([0-9]+)/)  # format 3 suffices
-    {  my $opcode=(0x14<<26)|($2<<21)|($3<<16)|($1<<1);
-       $opcode|=0x8 if ($mod eq ",ma");
+    if ($args =~ /(\-[0-9]+)\(%r([0-9]+)\),%r([0-9]+)/)        # format 3 suffices
+    {  my $opcode=(0x14<<26)|($2<<21)|($3<<16)|(($1&0x1FF8)<<1)|(($1>>13)&1);
+       $opcode|=(1<<3) if ($mod =~ /^,m/);
+       $opcode|=(1<<2) if ($mod =~ /^,mb/);
        sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig;
     }
     else { "\t".$orig; }
@@ -706,9 +707,9 @@ my $std = sub {
   my ($mod,$args) = @_;
   my $orig = "std$mod\t$args";
 
-    if ($args =~ /%r([0-9]+),([0-9]+)\(%r([0-9]+)\)/)  # format 3 suffices
-    {  sprintf "\t.WORD\t0x%08x\t; %s",
-               (0x1c<<26)|($3<<21)|($1<<16)|($2<<1),$orig;
+    if ($args =~ /%r([0-9]+),(\-[0-9]+)\(%r([0-9]+)\)/)        # format 3 suffices
+    {  my $opcode=(0x1c<<26)|($3<<21)|($1<<16)|(($2&0x1FF8)<<1)|(($2>>13)&1);
+       sprintf "\t.WORD\t0x%08x\t; %s",$opcode,$orig;
     }
     else { "\t".$orig; }
 };