summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sparccpuid.S
diff options
context:
space:
mode:
authordjm <>2011-11-03 02:32:23 +0000
committerdjm <>2011-11-03 02:32:23 +0000
commit113f799ec7d1728f0a5d7ab5b0e3b42e3de56407 (patch)
tree26d712b25a8fa580b8f2dfc6df470ba5ffea9eb7 /src/lib/libcrypto/sparccpuid.S
parent829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2 (diff)
downloadopenbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.gz
openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.bz2
openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.zip
import OpenSSL 1.0.0e
Diffstat (limited to 'src/lib/libcrypto/sparccpuid.S')
-rw-r--r--src/lib/libcrypto/sparccpuid.S84
1 files changed, 83 insertions, 1 deletions
diff --git a/src/lib/libcrypto/sparccpuid.S b/src/lib/libcrypto/sparccpuid.S
index aa8b11efc9..ae61f7f5ce 100644
--- a/src/lib/libcrypto/sparccpuid.S
+++ b/src/lib/libcrypto/sparccpuid.S
@@ -225,13 +225,95 @@ _sparcv9_rdtick:
225 xor %o0,%o0,%o0 225 xor %o0,%o0,%o0
226 .word 0x91410000 !rd %tick,%o0 226 .word 0x91410000 !rd %tick,%o0
227 retl 227 retl
228 .word 0x93323020 !srlx %o2,32,%o1 228 .word 0x93323020 !srlx %o0,32,%o1
229.notick: 229.notick:
230 retl 230 retl
231 xor %o1,%o1,%o1 231 xor %o1,%o1,%o1
232.type _sparcv9_rdtick,#function 232.type _sparcv9_rdtick,#function
233.size _sparcv9_rdtick,.-_sparcv9_rdtick 233.size _sparcv9_rdtick,.-_sparcv9_rdtick
234 234
235.global _sparcv9_vis1_probe
236.align 8
237_sparcv9_vis1_probe:
238 .word 0x81b00d80 !fxor %f0,%f0,%f0
239 add %sp,BIAS+2,%o1
240 retl
241 .word 0xc19a5a40 !ldda [%o1]ASI_FP16_P,%f0
242.type _sparcv9_vis1_probe,#function
243.size _sparcv9_vis1_probe,.-_sparcv9_vis1_probe
244
245! Probe and instrument VIS1 instruction. Output is number of cycles it
246! takes to execute rdtick and pair of VIS1 instructions. US-Tx VIS unit
247! is slow (documented to be 6 cycles on T2) and the core is in-order
248! single-issue, it should be possible to distinguish Tx reliably...
249! Observed return values are:
250!
251! UltraSPARC IIe 7
252! UltraSPARC III 7
253! UltraSPARC T1 24
254!
255! Numbers for T2 and SPARC64 V-VII are more than welcomed.
256!
257! It would be possible to detect specifically US-T1 by instrumenting
258! fmul8ulx16, which is emulated on T1 and as such accounts for quite
259! a lot of %tick-s, couple of thousand on Linux...
260.global _sparcv9_vis1_instrument
261.align 8
262_sparcv9_vis1_instrument:
263 .word 0x91410000 !rd %tick,%o0
264 .word 0x81b00d80 !fxor %f0,%f0,%f0
265 .word 0x85b08d82 !fxor %f2,%f2,%f2
266 .word 0x93410000 !rd %tick,%o1
267 .word 0x81b00d80 !fxor %f0,%f0,%f0
268 .word 0x85b08d82 !fxor %f2,%f2,%f2
269 .word 0x95410000 !rd %tick,%o2
270 .word 0x81b00d80 !fxor %f0,%f0,%f0
271 .word 0x85b08d82 !fxor %f2,%f2,%f2
272 .word 0x97410000 !rd %tick,%o3
273 .word 0x81b00d80 !fxor %f0,%f0,%f0
274 .word 0x85b08d82 !fxor %f2,%f2,%f2
275 .word 0x99410000 !rd %tick,%o4
276
277 ! calculate intervals
278 sub %o1,%o0,%o0
279 sub %o2,%o1,%o1
280 sub %o3,%o2,%o2
281 sub %o4,%o3,%o3
282
283 ! find minumum value
284 cmp %o0,%o1
285 .word 0x38680002 !bgu,a %xcc,.+8
286 mov %o1,%o0
287 cmp %o0,%o2
288 .word 0x38680002 !bgu,a %xcc,.+8
289 mov %o2,%o0
290 cmp %o0,%o3
291 .word 0x38680002 !bgu,a %xcc,.+8
292 mov %o3,%o0
293
294 retl
295 nop
296.type _sparcv9_vis1_instrument,#function
297.size _sparcv9_vis1_instrument,.-_sparcv9_vis1_instrument
298
299.global _sparcv9_vis2_probe
300.align 8
301_sparcv9_vis2_probe:
302 retl
303 .word 0x81b00980 !bshuffle %f0,%f0,%f0
304.type _sparcv9_vis2_probe,#function
305.size _sparcv9_vis2_probe,.-_sparcv9_vis2_probe
306
307.global _sparcv9_fmadd_probe
308.align 8
309_sparcv9_fmadd_probe:
310 .word 0x81b00d80 !fxor %f0,%f0,%f0
311 .word 0x85b08d82 !fxor %f2,%f2,%f2
312 retl
313 .word 0x81b80440 !fmaddd %f0,%f0,%f2,%f0
314.type _sparcv9_fmadd_probe,#function
315.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe
316
235.global OPENSSL_cleanse 317.global OPENSSL_cleanse
236.align 32 318.align 32
237OPENSSL_cleanse: 319OPENSSL_cleanse: