]> granicus.if.org Git - openssl/commitdiff
crpyto/ppccpuid.pl: add FPU probe and fix OPENSSL_rdtsc.
authorAndy Polyakov <appro@openssl.org>
Fri, 13 Nov 2015 23:16:37 +0000 (00:16 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 14 Dec 2015 15:09:25 +0000 (16:09 +0100)
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
crypto/ppccpuid.pl

index 56cc851c1d3a12c9554116d4ab149482762e5d61..4c2530d147ae9aa61c15a6a94e77b02909de482c 100755 (executable)
@@ -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