]>
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 .globl
.OPENSSL_altivec_probe
35 .OPENSSL_altivec_probe
:
36 .long
0x10000484 # vor v0,v0,v0
39 .globl
.OPENSSL_wipe_cpu
69 .globl
.OPENSSL_atomic_add
86 .globl
.OPENSSL_cleanse
116 my ($out,$cnt,$max)=("r3","r4","r5");
117 my ($tick,$lasttick)=("r6","r7");
118 my ($diff,$lastdiff)=("r8","r9");
121 .globl
.OPENSSL_instrument_bus
123 .OPENSSL_instrument_bus
:
126 mftb
$lasttick # collect 1st tick
129 dcbf
0,$out # flush cache line
130 lwarx
$tick,0,$out # load and lock
131 add
$tick,$tick,$diff
136 sub $diff,$tick,$lasttick
138 dcbf
0,$out # flush cache line
139 lwarx
$tick,0,$out # load and lock
140 add
$tick,$tick,$diff
143 addi
$out,$out,4 # ++$out
149 .globl
.OPENSSL_instrument_bus2
151 .OPENSSL_instrument_bus2
:
155 mftb
$lasttick # collect 1st tick
158 dcbf
0,$out # flush cache line
159 lwarx
$tick,0,$out # load and lock
160 add
$tick,$tick,$diff
164 mftb
$tick # collect 1st diff
165 sub $diff,$tick,$lasttick
169 dcbf
0,$out # flush cache line
170 lwarx
$tick,0,$out # load and lock
171 add
$tick,$tick,$diff
179 sub $diff,$tick,$lasttick
181 cmplw
7,$diff,$lastdiff
185 not $tick,$tick # flip bits
186 rlwinm
$tick,$tick,1,29,29 # isolate flipped eq bit and scale
188 sub. $cnt,$cnt,$tick # conditional --$cnt
189 add
$out,$out,$tick # conditional ++$out
199 $code =~ s/\`([^\`]*)\`/eval $1/gem;