crypto/armcap.c: detect ARMv8 capabilities [in 32-bit build].
[openssl.git] / crypto / armv4cpuid.S
index c9102ca2a57e7643a576e11f78c3f776824a6e20..edd619800fc825214e7a76c90f84907008a41091 100644 (file)
@@ -18,6 +18,34 @@ _armv7_tick:
        .word   0xe12fff1e      @ bx    lr
 .size  _armv7_tick,.-_armv7_tick
 
+.global        _armv8_aes_probe
+.type  _armv8_aes_probe,%function
+_armv8_aes_probe:
+       .word   0xf3b00300      @ aese.8        q0,q0
+       .word   0xe12fff1e      @ bx    lr
+.size  _armv8_aes_probe,.-_armv8_aes_probe
+
+.global        _armv8_sha1_probe
+.type  _armv8_sha1_probe,%function
+_armv8_sha1_probe:
+       .word   0xf2000c40      @ sha1c.32      q0,q0,q0
+       .word   0xe12fff1e      @ bx    lr
+.size  _armv8_sha1_probe,.-_armv8_sha1_probe
+
+.global        _armv8_sha256_probe
+.type  _armv8_sha256_probe,%function
+_armv8_sha256_probe:
+       .word   0xf3000c40      @ sha256h.32    q0,q0,q0
+       .word   0xe12fff1e      @ bx    lr
+.size  _armv8_sha256_probe,.-_armv8_sha256_probe
+.global        _armv8_pmull_probe
+.type  _armv8_pmull_probe,%function
+_armv8_pmull_probe:
+       .word   0xf2a00e00      @ vmull.p64     q0,d0,d0
+       .word   0xe12fff1e      @ bx    lr
+.size  _armv8_pmull_probe,.-_armv8_pmull_probe
+
+.align 5
 .global        OPENSSL_atomic_add
 .type  OPENSSL_atomic_add,%function
 OPENSSL_atomic_add:
@@ -44,7 +72,7 @@ OPENSSL_atomic_add:
        bne     .Lspin
 
        ldr     r2,[r4]
-       add     r2,r5
+       add     r2,r2,r5
        str     r2,[r4]
        str     r0,[r6]         @ release spinlock
        ldmia   sp!,{r4-r6,lr}
@@ -59,26 +87,26 @@ OPENSSL_atomic_add:
 OPENSSL_cleanse:
        eor     ip,ip,ip
        cmp     r1,#7
-       subhs   r1,#4
+       subhs   r1,r1,#4
        bhs     .Lot
        cmp     r1,#0
        beq     .Lcleanse_done
 .Little:
        strb    ip,[r0],#1
-       subs    r1,#1
+       subs    r1,r1,#1
        bhi     .Little
        b       .Lcleanse_done
 
 .Lot:  tst     r0,#3
        beq     .Laligned
        strb    ip,[r0],#1
-       sub     r1,#1
+       sub     r1,r1,#1
        b       .Lot
 .Laligned:
        str     ip,[r0],#4
-       subs    r1,#4
+       subs    r1,r1,#4
        bhs     .Laligned
-       adds    r1,#4
+       adds    r1,r1,#4
        bne     .Little
 .Lcleanse_done:
        tst     lr,#1