bmake-ify mega_sas
[unleashed.git] / lib / libcrypto / pariscid.pl
blobda74a2836cec2a7cc1e96d005977f5e9bd2121f8
1 #!/usr/bin/env perl
3 $flavour = shift;
4 $output = shift;
5 open STDOUT,">$output";
7 if ($flavour =~ /64/) {
8 $LEVEL ="2.0W";
9 $SIZE_T =8;
10 $ST ="std";
11 } else {
12 $LEVEL ="1.1";
13 $SIZE_T =4;
14 $ST ="stw";
17 $rp="%r2";
18 $sp="%r30";
19 $rv="%r28";
21 $code=<<___;
22 .LEVEL $LEVEL
23 #if 0
24 .SPACE \$TEXT\$
25 .SUBSPA \$CODE\$,QUAD=0,ALIGN=8,ACCESS=0x2C,CODE_ONLY
26 #else
27 .text
28 #endif
30 .EXPORT OPENSSL_cpuid_setup,ENTRY
31 .ALIGN 8
32 OPENSSL_cpuid_setup
33 .PROC
34 .CALLINFO NO_CALLS
35 .ENTRY
36 bv ($rp)
37 .EXIT
38 nop
39 .PROCEND
41 .EXPORT OPENSSL_wipe_cpu,ENTRY
42 .ALIGN 8
43 OPENSSL_wipe_cpu
44 .PROC
45 .CALLINFO NO_CALLS
46 .ENTRY
47 xor %r0,%r0,%r1
48 fcpy,dbl %fr0,%fr4
49 xor %r0,%r0,%r19
50 fcpy,dbl %fr0,%fr5
51 xor %r0,%r0,%r20
52 fcpy,dbl %fr0,%fr6
53 xor %r0,%r0,%r21
54 fcpy,dbl %fr0,%fr7
55 xor %r0,%r0,%r22
56 fcpy,dbl %fr0,%fr8
57 xor %r0,%r0,%r23
58 fcpy,dbl %fr0,%fr9
59 xor %r0,%r0,%r24
60 fcpy,dbl %fr0,%fr10
61 xor %r0,%r0,%r25
62 fcpy,dbl %fr0,%fr11
63 xor %r0,%r0,%r26
64 fcpy,dbl %fr0,%fr22
65 xor %r0,%r0,%r29
66 fcpy,dbl %fr0,%fr23
67 xor %r0,%r0,%r31
68 fcpy,dbl %fr0,%fr24
69 fcpy,dbl %fr0,%fr25
70 fcpy,dbl %fr0,%fr26
71 fcpy,dbl %fr0,%fr27
72 fcpy,dbl %fr0,%fr28
73 fcpy,dbl %fr0,%fr29
74 fcpy,dbl %fr0,%fr30
75 fcpy,dbl %fr0,%fr31
76 bv ($rp)
77 .EXIT
78 ldo 0($sp),$rv
79 .PROCEND
80 ___
81 $code =~ s/cmpib,\*/comib,/gm if ($SIZE_T==4);
82 $code =~ s/,\*/,/gm if ($SIZE_T==4);
83 $code =~ s/\bbv\b/bve/gm if ($SIZE_T==8);
84 print $code;
85 close STDOUT;