Add alphacpuid.s
[openssl.git] / crypto / alphacpuid.s
1 .text
2
3 .set    noat
4
5 .globl  OPENSSL_wipe_cpu
6 .ent    OPENSSL_wipe_cpu
7 OPENSSL_wipe_cpu:
8         .frame  $30,0,$26
9         .prologue 0
10         clr     $1
11         clr     $2
12         clr     $3
13         clr     $4
14         clr     $5
15         clr     $6
16         clr     $7
17         clr     $8
18         clr     $16
19         clr     $17
20         clr     $18
21         clr     $19
22         clr     $20
23         clr     $21
24         clr     $22
25         clr     $23
26         clr     $24
27         clr     $25
28         clr     $27
29         clr     $at
30         clr     $29
31         fclr    $f0
32         fclr    $f1
33         fclr    $f10
34         fclr    $f11
35         fclr    $f12
36         fclr    $f13
37         fclr    $f14
38         fclr    $f15
39         fclr    $f16
40         fclr    $f17
41         fclr    $f18
42         fclr    $f19
43         fclr    $f20
44         fclr    $f21
45         fclr    $f22
46         fclr    $f23
47         fclr    $f24
48         fclr    $f25
49         fclr    $f26
50         fclr    $f27
51         fclr    $f28
52         fclr    $f29
53         fclr    $f30
54         mov     $sp,$0
55         ret     ($26)
56 .end    OPENSSL_wipe_cpu
57
58 .globl  OPENSSL_atomic_add
59 .ent    OPENSSL_atomic_add
60 OPENSSL_atomic_add:
61         .frame  $30,0,$26
62         .prologue 0
63 1:      ldl_l   $0,($16)
64         addl    $0,$17,$1
65         stl_c   $1,($16)
66         beq     $1,1b
67         addl    $0,$17,$0
68         ret     ($26)
69 .end    OPENSSL_atomic_add
70
71 .globl  OPENSSL_rdtsc
72 .ent    OPENSSL_rdtsc
73 OPENSSL_rdtsc:
74         .frame  $30,0,$26
75         .prologue 0
76         rpcc    $0
77         ret     ($26)
78 .end    OPENSSL_rdtsc
79
80 .globl  OPENSSL_cleanse
81 .ent    OPENSSL_cleanse
82 OPENSSL_cleanse:
83         .frame  $30,0,$26
84         .prologue 0
85         and     $16,7,$0
86         bic     $17,7,$at
87         beq     $at,.Little
88         beq     $0,.Laligned
89
90 .Little:
91         ldq_u   $1,0($16)
92         mov     $16,$2
93 .Lalign:
94         mskbl   $1,$16,$1
95         lda     $16,1($16)
96         subq    $17,1,$17
97         subq    $0,1,$0
98         beq     $17,.Lout
99         bne     $0,.Lalign
100 .Lout:  stq_u   $1,0($2)
101         beq     $17,.Ldone
102         bic     $17,7,$at
103         mov     $17,$0
104         beq     $at,.Little
105
106 .Laligned:
107         stq     $31,0($16)
108         subq    $17,8,$17
109         lda     $16,8($16)
110         bic     $17,7,$at
111         bne     $at,.Laligned
112         beq     $17,.Ldone
113         mov     $17,$0
114         br      .Little
115 .Ldone: ret     ($26)
116 .end    OPENSSL_cleanse