]>
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
34 .size
.OPENSSL_ppc64_probe
,.-.OPENSSL_ppc64_probe
36 .globl
.OPENSSL_altivec_probe
38 .OPENSSL_altivec_probe
:
39 .long
0x10000484 # vor v0,v0,v0
42 .byte
0,12,0x14,0,0,0,0,0
43 .size
.OPENSSL_altivec_probe
,.-..OPENSSL_altivec_probe
45 .globl
.OPENSSL_crypto207_probe
47 .OPENSSL_crypto207_probe
:
52 .byte
0,12,0x14,0,0,0,0,0
53 .size
.OPENSSL_crypto207_probe
,.-.OPENSSL_crypto207_probe
55 .globl
.OPENSSL_wipe_cpu
85 .byte
0,12,0x14,0,0,0,0,0
86 .size
.OPENSSL_wipe_cpu
,.-.OPENSSL_wipe_cpu
88 .globl
.OPENSSL_atomic_add
98 .byte
0,12,0x14,0,0,0,2,0
100 .size
.OPENSSL_atomic_add
,.-.OPENSSL_atomic_add
102 .globl
.OPENSSL_rdtsc
109 .byte
0,12,0x14,0,0,0,0,0
110 .size
.OPENSSL_rdtsc
,.-.OPENSSL_rdtsc
112 .globl
.OPENSSL_cleanse
141 .byte
0,12,0x14,0,0,0,2,0
143 .size
.OPENSSL_cleanse
,.-.OPENSSL_cleanse
146 my ($out,$cnt,$max)=("r3","r4","r5");
147 my ($tick,$lasttick)=("r6","r7");
148 my ($diff,$lastdiff)=("r8","r9");
151 .globl
.OPENSSL_instrument_bus
153 .OPENSSL_instrument_bus
:
156 mftb
$lasttick # collect 1st tick
159 dcbf
0,$out # flush cache line
160 lwarx
$tick,0,$out # load and lock
161 add
$tick,$tick,$diff
166 sub $diff,$tick,$lasttick
168 dcbf
0,$out # flush cache line
169 lwarx
$tick,0,$out # load and lock
170 add
$tick,$tick,$diff
173 addi
$out,$out,4 # ++$out
179 .byte
0,12,0x14,0,0,0,2,0
181 .size
.OPENSSL_instrument_bus
,.-.OPENSSL_instrument_bus
183 .globl
.OPENSSL_instrument_bus2
185 .OPENSSL_instrument_bus2
:
189 mftb
$lasttick # collect 1st tick
192 dcbf
0,$out # flush cache line
193 lwarx
$tick,0,$out # load and lock
194 add
$tick,$tick,$diff
198 mftb
$tick # collect 1st diff
199 sub $diff,$tick,$lasttick
203 dcbf
0,$out # flush cache line
204 lwarx
$tick,0,$out # load and lock
205 add
$tick,$tick,$diff
213 sub $diff,$tick,$lasttick
215 cmplw
7,$diff,$lastdiff
219 not $tick,$tick # flip bits
220 rlwinm
$tick,$tick,1,29,29 # isolate flipped eq bit and scale
222 sub. $cnt,$cnt,$tick # conditional --$cnt
223 add
$out,$out,$tick # conditional ++$out
231 .byte
0,12,0x14,0,0,0,3,0
233 .size
.OPENSSL_instrument_bus2
,.-.OPENSSL_instrument_bus2
237 $code =~ s/\`([^\`]*)\`/eval $1/gem;