summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sparccpuid.S
diff options
context:
space:
mode:
authormiod <>2014-04-17 18:16:45 +0000
committermiod <>2014-04-17 18:16:45 +0000
commit6b39fdab5868da712ead9164b4680bd7a7d86773 (patch)
tree90883ba640e038606eee09fb5c784c3df7903a8e /src/lib/libcrypto/sparccpuid.S
parentd2037bc80eb83a1694b3e3458e6df04d0b9b29f1 (diff)
downloadopenbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.tar.gz
openbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.tar.bz2
openbsd-6b39fdab5868da712ead9164b4680bd7a7d86773.zip
Ok, there was a need for OPENSSL_cleanse() instead of bzero() to prevent
supposedly smart compilers from optimizing memory cleanups away. Understood. Ok, in case of an hypothetically super smart compiler, OPENSSL_cleanse() had to be convoluted enough for the compiler not to recognize that this was actually bzero() in disguise. Understood. But then why there had been optimized assembler versions of OPENSSL_cleanse() is beyond me. Did someone not trust the C obfuscation?
Diffstat (limited to 'src/lib/libcrypto/sparccpuid.S')
-rw-r--r--src/lib/libcrypto/sparccpuid.S83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/lib/libcrypto/sparccpuid.S b/src/lib/libcrypto/sparccpuid.S
index 0cc247e489..d8b44af2f0 100644
--- a/src/lib/libcrypto/sparccpuid.S
+++ b/src/lib/libcrypto/sparccpuid.S
@@ -314,89 +314,6 @@ _sparcv9_fmadd_probe:
314.type _sparcv9_fmadd_probe,#function 314.type _sparcv9_fmadd_probe,#function
315.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe 315.size _sparcv9_fmadd_probe,.-_sparcv9_fmadd_probe
316 316
317.global OPENSSL_cleanse
318.align 32
319OPENSSL_cleanse:
320 cmp %o1,14
321 nop
322#ifdef ABI64
323 bgu %xcc,.Lot
324#else
325 bgu .Lot
326#endif
327 cmp %o1,0
328 bne .Little
329 nop
330 retl
331 nop
332
333.Little:
334 stb %g0,[%o0]
335 subcc %o1,1,%o1
336 bnz .Little
337 add %o0,1,%o0
338 retl
339 nop
340.align 32
341.Lot:
342#ifndef ABI64
343 subcc %g0,1,%g1
344 ! see above for explanation
345 .word 0x83408000 !rd %ccr,%g1
346 cmp %g1,0x99
347 bne .v8lot
348 nop
349#endif
350
351.v9lot: andcc %o0,7,%g0
352 bz .v9aligned
353 nop
354 stb %g0,[%o0]
355 sub %o1,1,%o1
356 ba .v9lot
357 add %o0,1,%o0
358.align 16,0x01000000
359.v9aligned:
360 .word 0xc0720000 !stx %g0,[%o0]
361 sub %o1,8,%o1
362 andcc %o1,-8,%g0
363#ifdef ABI64
364 .word 0x126ffffd !bnz %xcc,.v9aligned
365#else
366 .word 0x124ffffd !bnz %icc,.v9aligned
367#endif
368 add %o0,8,%o0
369
370 cmp %o1,0
371 bne .Little
372 nop
373 retl
374 nop
375#ifndef ABI64
376.v8lot: andcc %o0,3,%g0
377 bz .v8aligned
378 nop
379 stb %g0,[%o0]
380 sub %o1,1,%o1
381 ba .v8lot
382 add %o0,1,%o0
383 nop
384.v8aligned:
385 st %g0,[%o0]
386 sub %o1,4,%o1
387 andcc %o1,-4,%g0
388 bnz .v8aligned
389 add %o0,4,%o0
390
391 cmp %o1,0
392 bne .Little
393 nop
394 retl
395 nop
396#endif
397.type OPENSSL_cleanse,#function
398.size OPENSSL_cleanse,.-OPENSSL_cleanse
399
400.section ".init",#alloc,#execinstr 317.section ".init",#alloc,#execinstr
401 call OPENSSL_cpuid_setup 318 call OPENSSL_cpuid_setup
402 nop 319 nop