crypto/ppc[cpuid|cap]: call CPU detection once and detect AltiVec.
[openssl.git] / crypto / ppccpuid.pl
index a52a8b38d0c0a877470c756511613c1649bd9589..2131d30c1d272fc89e10260cbe5b16831004a9e4 100755 (executable)
@@ -30,6 +30,12 @@ $code=<<___;
        extrdi  r0,r0,32,0
        blr
 
+.globl .OPENSSL_altivec_probe
+.align 4
+.OPENSSL_altivec_probe:
+       .long   0x10000484      # vor   v0,v0,v0
+       blr
+
 .globl .OPENSSL_wipe_cpu
 .align 4
 .OPENSSL_wipe_cpu:
@@ -83,6 +89,8 @@ Loop: lwarx   r5,0,r3
        $CMPLI  r4,7
        li      r0,0
        bge     Lot
+       $CMPLI  r4,0
+       beqlr-
 Little:        mtctr   r4
        stb     r0,0(r3)
        addi    r3,r3,1