Return an error if no recipient type matches.
[openssl.git] / crypto / alphacpuid.pl
index 57a473b..5b0e21b 100644 (file)
@@ -70,9 +70,9 @@ OPENSSL_wipe_cpu:
 OPENSSL_atomic_add:
        .frame  $30,0,$26
        .prologue 0
-1:     ldl_l   $0,($16)
+1:     ldl_l   $0,0($16)
        addl    $0,$17,$1
-       stl_c   $1,($16)
+       stl_c   $1,0($16)
        beq     $1,1b
        addl    $0,$17,$0
        ret     ($26)
@@ -99,19 +99,19 @@ OPENSSL_cleanse:
        beq     $0,.Laligned
 
 .Little:
+       subq    $0,8,$0
        ldq_u   $1,0($16)
        mov     $16,$2
 .Lalign:
        mskbl   $1,$16,$1
        lda     $16,1($16)
        subq    $17,1,$17
-       subq    $0,1,$0
+       addq    $0,1,$0
        beq     $17,.Lout
        bne     $0,.Lalign
 .Lout: stq_u   $1,0($2)
        beq     $17,.Ldone
        bic     $17,7,$at
-       mov     $17,$0
        beq     $at,.Little
 
 .Laligned:
@@ -120,9 +120,97 @@ OPENSSL_cleanse:
        lda     $16,8($16)
        bic     $17,7,$at
        bne     $at,.Laligned
-       beq     $17,.Ldone
-       mov     $17,$0
-       br      .Little
+       bne     $17,.Little
 .Ldone: ret    ($26)
 .end   OPENSSL_cleanse
 ___
+{
+my ($out,$cnt,$max)=("\$16","\$17","\$18");
+my ($tick,$lasttick)=("\$19","\$20");
+my ($diff,$lastdiff)=("\$21","\$22");
+my ($v0,$ra,$sp,$zero)=("\$0","\$26","\$30","\$31");
+
+print <<___;
+.globl OPENSSL_instrument_bus
+.ent   OPENSSL_instrument_bus
+OPENSSL_instrument_bus:
+       .frame  $sp,0,$ra
+       .prologue 0
+       mov     $cnt,$v0
+
+       rpcc    $lasttick
+       mov     0,$diff
+
+       ecb     ($out)
+       ldl_l   $tick,0($out)
+       addl    $diff,$tick,$tick
+       mov     $tick,$diff
+       stl_c   $tick,0($out)
+       stl     $diff,0($out)
+
+.Loop: rpcc    $tick
+       subq    $tick,$lasttick,$diff
+       mov     $tick,$lasttick
+
+       ecb     ($out)
+       ldl_l   $tick,0($out)
+       addl    $diff,$tick,$tick
+       mov     $tick,$diff
+       stl_c   $tick,0($out)
+       stl     $diff,0($out)
+
+       subl    $cnt,1,$cnt
+       lda     $out,4($out)
+       bne     $cnt,.Loop
+
+       ret     ($ra)
+.end   OPENSSL_instrument_bus
+
+.globl OPENSSL_instrument_bus2
+.ent   OPENSSL_instrument_bus2
+OPENSSL_instrument_bus2:
+       .frame  $sp,0,$ra
+       .prologue 0
+       mov     $cnt,$v0
+
+       rpcc    $lasttick
+       mov     0,$diff
+
+       ecb     ($out)
+       ldl_l   $tick,0($out)
+       addl    $diff,$tick,$tick
+       mov     $tick,$diff
+       stl_c   $tick,0($out)
+       stl     $diff,0($out)
+
+       rpcc    $tick
+       subq    $tick,$lasttick,$diff
+       mov     $tick,$lasttick
+       mov     $diff,$lastdiff
+.Loop2:
+       ecb     ($out)
+       ldl_l   $tick,0($out)
+       addl    $diff,$tick,$tick
+       mov     $tick,$diff
+       stl_c   $tick,0($out)
+       stl     $diff,0($out)
+
+       subl    $max,1,$max
+       beq     $max,.Ldone2
+
+       rpcc    $tick
+       subq    $tick,$lasttick,$diff
+       mov     $tick,$lasttick
+       subq    $lastdiff,$diff,$tick
+       mov     $diff,$lastdiff
+       cmovne  $tick,1,$tick
+       subl    $cnt,$tick,$cnt
+       s4addq  $tick,$out,$out
+       bne     $cnt,.Loop2
+
+.Ldone2:
+       subl    $v0,$cnt,$v0
+       ret     ($ra)
+.end   OPENSSL_instrument_bus2
+___
+}