From 81eae077ce679c1d7d29e19991bf055e4888a2fc Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 14 Nov 2015 00:16:37 +0100 Subject: [PATCH] crpyto/ppccpuid.pl: add FPU probe and fix OPENSSL_rdtsc. Reviewed-by: Kurt Roeckx --- crypto/ppccpuid.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crypto/ppccpuid.pl b/crypto/ppccpuid.pl index 56cc851c1d..4c2530d147 100755 --- a/crypto/ppccpuid.pl +++ b/crypto/ppccpuid.pl @@ -23,6 +23,14 @@ $code=<<___; .machine "any" .text +.globl .OPENSSL_fpu_probe +.align 4 +.OPENSSL_fpu_probe: + fmr f0,f0 + blr + .long 0 + .byte 0,12,0x14,0,0,0,0,0 +.size .OPENSSL_fpu_probe,.-.OPENSSL_fpu_probe .globl .OPENSSL_ppc64_probe .align 4 .OPENSSL_ppc64_probe: @@ -102,8 +110,19 @@ Ladd: lwarx r5,0,r3 .globl .OPENSSL_rdtsc .align 4 .OPENSSL_rdtsc: +___ +$code.=<<___ if ($flavour =~ /64/); + mftb r3 +___ +$code.=<<___ if ($flavour !~ /64/); +Loop_rdtsc: + mftbu r5 mftb r3 mftbu r4 + cmplw r4,r5 + bne Loop_rdtsc +___ +$code.=<<___; blr .long 0 .byte 0,12,0x14,0,0,0,0,0 -- 2.40.0