]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/ppccpuid.pl
5 $0 =~ m/(.*[\/\\])[^\
/\\]+$/; $dir=$1;
6 ( $xlate="${dir}ppc-xlate.pl" and -f
$xlate ) or
7 ( $xlate="${dir}perlasm/ppc-xlate.pl" and -f
$xlate) or
8 die "can't locate ppc-xlate.pl";
10 open STDOUT
,"| $^X $xlate $flavour ".shift || die "can't call $xlate: $!";
26 .globl
.OPENSSL_ppc64_probe
33 .byte
0,12,0x14,0,0,0,0,0
35 .globl
.OPENSSL_altivec_probe
37 .OPENSSL_altivec_probe
:
38 .long
0x10000484 # vor v0,v0,v0
41 .byte
0,12,0x14,0,0,0,0,0
43 .globl
.OPENSSL_wipe_cpu
73 .byte
0,12,0x14,0,0,0,0,0
75 .globl
.OPENSSL_atomic_add
85 .byte
0,12,0x14,0,0,0,2,0
95 .byte
0,12,0x14,0,0,0,0,0
97 .globl
.OPENSSL_cleanse
126 .byte
0,12,0x14,0,0,0,2,0
130 my ($out,$cnt,$max)=("r3","r4","r5");
131 my ($tick,$lasttick)=("r6","r7");
132 my ($diff,$lastdiff)=("r8","r9");
135 .globl
.OPENSSL_instrument_bus
137 .OPENSSL_instrument_bus
:
140 mftb
$lasttick # collect 1st tick
143 dcbf
0,$out # flush cache line
144 lwarx
$tick,0,$out # load and lock
145 add
$tick,$tick,$diff
150 sub $diff,$tick,$lasttick
152 dcbf
0,$out # flush cache line
153 lwarx
$tick,0,$out # load and lock
154 add
$tick,$tick,$diff
157 addi
$out,$out,4 # ++$out
163 .byte
0,12,0x14,0,0,0,2,0
166 .globl
.OPENSSL_instrument_bus2
168 .OPENSSL_instrument_bus2
:
172 mftb
$lasttick # collect 1st tick
175 dcbf
0,$out # flush cache line
176 lwarx
$tick,0,$out # load and lock
177 add
$tick,$tick,$diff
181 mftb
$tick # collect 1st diff
182 sub $diff,$tick,$lasttick
186 dcbf
0,$out # flush cache line
187 lwarx
$tick,0,$out # load and lock
188 add
$tick,$tick,$diff
196 sub $diff,$tick,$lasttick
198 cmplw
7,$diff,$lastdiff
202 not $tick,$tick # flip bits
203 rlwinm
$tick,$tick,1,29,29 # isolate flipped eq bit and scale
205 sub. $cnt,$cnt,$tick # conditional --$cnt
206 add
$out,$out,$tick # conditional ++$out
214 .byte
0,12,0x14,0,0,0,3,0
219 $code =~ s/\`([^\`]*)\`/eval $1/gem;