Switch to unified syntax so these can be built with clang 3.5.

MFC after:	1 week
Sponsored by:	ABT Systems Ltd
This commit is contained in:
andrew 2014-12-02 18:37:04 +00:00
parent eb2b82c507
commit b7064605f4
4 changed files with 181 additions and 174 deletions

View File

@ -38,6 +38,7 @@
#include <machine/asm.h> #include <machine/asm.h>
__FBSDID("$FreeBSD$"); __FBSDID("$FreeBSD$");
.syntax unified
.text .text
.align 0 .align 0
@ -104,8 +105,8 @@ ENTRY(copyin)
ldr r0, =EFAULT ldr r0, =EFAULT
str r11, [r10, #PCB_ONFAULT] str r11, [r10, #PCB_ONFAULT]
cmp r3, #0x00 cmp r3, #0x00
ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */
ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */
ldmfd sp!, {r10-r11, pc} ldmfd sp!, {r10-r11, pc}
.Lcopyin_guts: .Lcopyin_guts:
@ -138,7 +139,7 @@ ENTRY(copyin)
/* Quad-align the destination buffer */ /* Quad-align the destination buffer */
tst r1, #0x07 /* Already quad aligned? */ tst r1, #0x07 /* Already quad aligned? */
ldrnet ip, [r0], #0x04 ldrtne ip, [r0], #0x04
strne ip, [r1], #0x04 strne ip, [r1], #0x04
subne r2, r2, #0x04 subne r2, r2, #0x04
stmfd sp!, {r4-r9} /* Free up some registers */ stmfd sp!, {r4-r9} /* Free up some registers */
@ -207,7 +208,7 @@ ENTRY(copyin)
.Lcopyin_w_lessthan128: .Lcopyin_w_lessthan128:
adds r2, r2, #0x80 /* Adjust for extra sub */ adds r2, r2, #0x80 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq RETeq
subs r2, r2, #0x20 subs r2, r2, #0x20
blt .Lcopyin_w_lessthan32 blt .Lcopyin_w_lessthan32
@ -232,7 +233,7 @@ ENTRY(copyin)
.Lcopyin_w_lessthan32: .Lcopyin_w_lessthan32:
adds r2, r2, #0x20 /* Adjust for extra sub */ adds r2, r2, #0x20 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq /* Return now if done */ RETeq /* Return now if done */
and r4, r2, #0x18 and r4, r2, #0x18
@ -266,17 +267,17 @@ ENTRY(copyin)
.Lcopyin_w_less_than8: .Lcopyin_w_less_than8:
subs r2, r2, #0x04 subs r2, r2, #0x04
ldrget ip, [r0], #0x04 ldrtge ip, [r0], #0x04
strge ip, [r1], #0x04 strge ip, [r1], #0x04
RETeq /* Return now if done */ RETeq /* Return now if done */
addlt r2, r2, #0x04 addlt r2, r2, #0x04
ldrbt ip, [r0], #0x01 ldrbt ip, [r0], #0x01
cmp r2, #0x02 cmp r2, #0x02
ldrgebt r2, [r0], #0x01 ldrbtge r2, [r0], #0x01
strb ip, [r1], #0x01 strb ip, [r1], #0x01
ldrgtbt ip, [r0] ldrbtgt ip, [r0]
strgeb r2, [r1], #0x01 strbge r2, [r1], #0x01
strgtb ip, [r1] strbgt ip, [r1]
RET RET
/* /*
@ -331,7 +332,7 @@ ENTRY(copyin)
bge .Lcopyin_bad1_loop16 bge .Lcopyin_bad1_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x03 sublt r0, r0, #0x03
@ -392,7 +393,7 @@ ENTRY(copyin)
bge .Lcopyin_bad2_loop16 bge .Lcopyin_bad2_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x02 sublt r0, r0, #0x02
@ -453,7 +454,7 @@ ENTRY(copyin)
bge .Lcopyin_bad3_loop16 bge .Lcopyin_bad3_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x01 sublt r0, r0, #0x01
@ -546,8 +547,8 @@ ENTRY(copyout)
ldr r0, =EFAULT ldr r0, =EFAULT
str r11, [r10, #PCB_ONFAULT] str r11, [r10, #PCB_ONFAULT]
cmp r3, #0x00 cmp r3, #0x00
ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */
ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */
ldmfd sp!, {r10-r11, pc} ldmfd sp!, {r10-r11, pc}
.Lcopyout_guts: .Lcopyout_guts:
@ -582,7 +583,7 @@ ENTRY(copyout)
tst r0, #0x07 /* Already quad aligned? */ tst r0, #0x07 /* Already quad aligned? */
ldrne ip, [r0], #0x04 ldrne ip, [r0], #0x04
subne r2, r2, #0x04 subne r2, r2, #0x04
strnet ip, [r1], #0x04 strtne ip, [r1], #0x04
stmfd sp!, {r4-r9} /* Free up some registers */ stmfd sp!, {r4-r9} /* Free up some registers */
mov r3, #-1 /* Signal restore r4-r9 */ mov r3, #-1 /* Signal restore r4-r9 */
@ -650,7 +651,7 @@ ENTRY(copyout)
.Lcopyout_w_lessthan128: .Lcopyout_w_lessthan128:
adds r2, r2, #0x80 /* Adjust for extra sub */ adds r2, r2, #0x80 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x20 subs r2, r2, #0x20
blt .Lcopyout_w_lessthan32 blt .Lcopyout_w_lessthan32
@ -675,7 +676,7 @@ ENTRY(copyout)
.Lcopyout_w_lessthan32: .Lcopyout_w_lessthan32:
adds r2, r2, #0x20 /* Adjust for extra sub */ adds r2, r2, #0x20 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq /* Return now if done */ RETeq /* Return now if done */
and r4, r2, #0x18 and r4, r2, #0x18
@ -710,16 +711,16 @@ ENTRY(copyout)
.Lcopyout_w_less_than8: .Lcopyout_w_less_than8:
subs r2, r2, #0x04 subs r2, r2, #0x04
ldrge ip, [r0], #0x04 ldrge ip, [r0], #0x04
strget ip, [r1], #0x04 strtge ip, [r1], #0x04
RETeq /* Return now if done */ RETeq /* Return now if done */
addlt r2, r2, #0x04 addlt r2, r2, #0x04
ldrb ip, [r0], #0x01 ldrb ip, [r0], #0x01
cmp r2, #0x02 cmp r2, #0x02
ldrgeb r2, [r0], #0x01 ldrbge r2, [r0], #0x01
strbt ip, [r1], #0x01 strbt ip, [r1], #0x01
ldrgtb ip, [r0] ldrbgt ip, [r0]
strgebt r2, [r1], #0x01 strbtge r2, [r1], #0x01
strgtbt ip, [r1] strbtgt ip, [r1]
RET RET
/* /*
@ -774,7 +775,7 @@ ENTRY(copyout)
bge .Lcopyout_bad1_loop16 bge .Lcopyout_bad1_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x03 sublt r0, r0, #0x03
@ -835,7 +836,7 @@ ENTRY(copyout)
bge .Lcopyout_bad2_loop16 bge .Lcopyout_bad2_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x02 sublt r0, r0, #0x02
@ -896,7 +897,7 @@ ENTRY(copyout)
bge .Lcopyout_bad3_loop16 bge .Lcopyout_bad3_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r0, r0, #0x01 sublt r0, r0, #0x01

View File

@ -50,6 +50,8 @@
__FBSDID("$FreeBSD$"); __FBSDID("$FreeBSD$");
.syntax unified
/* /*
* Read bytes from an I/O address into a block of memory * Read bytes from an I/O address into a block of memory
* *
@ -71,10 +73,10 @@ ENTRY(read_multi_1)
cmp r12, #2 cmp r12, #2
ldrb r3, [r0] ldrb r3, [r0]
strb r3, [r1], #1 strb r3, [r1], #1
ldrgeb r3, [r0] ldrbge r3, [r0]
strgeb r3, [r1], #1 strbge r3, [r1], #1
ldrgtb r3, [r0] ldrbgt r3, [r0]
strgtb r3, [r1], #1 strbgt r3, [r1], #1
subs r2, r2, r12 subs r2, r2, r12
blt .Lrm1_l4 blt .Lrm1_l4
.Lrm1_main: .Lrm1_main:
@ -91,15 +93,15 @@ ENTRY(read_multi_1)
bge .Lrm1loop bge .Lrm1loop
.Lrm1_l4: .Lrm1_l4:
adds r2, r2, #4 /* r2 = length again */ adds r2, r2, #4 /* r2 = length again */
ldmeqdb fp, {fp, sp, pc} ldmdbeq fp, {fp, sp, pc}
RETeq RETeq
cmp r2, #2 cmp r2, #2
ldrb r3, [r0] ldrb r3, [r0]
strb r3, [r1], #1 strb r3, [r1], #1
ldrgeb r3, [r0] ldrbge r3, [r0]
strgeb r3, [r1], #1 strbge r3, [r1], #1
ldrgtb r3, [r0] ldrbgt r3, [r0]
strgtb r3, [r1], #1 strbgt r3, [r1], #1
ldmdb fp, {fp, sp, pc} ldmdb fp, {fp, sp, pc}
END(read_multi_1) END(read_multi_1)
@ -124,10 +126,10 @@ ENTRY(write_multi_1)
cmp r12, #2 cmp r12, #2
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0] strb r3, [r0]
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0] strbge r3, [r0]
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0] strbgt r3, [r0]
subs r2, r2, r12 subs r2, r2, r12
blt .Lwm1_l4 blt .Lwm1_l4
.Lwm1_main: .Lwm1_main:
@ -144,14 +146,14 @@ ENTRY(write_multi_1)
bge .Lwm1loop bge .Lwm1loop
.Lwm1_l4: .Lwm1_l4:
adds r2, r2, #4 /* r2 = length again */ adds r2, r2, #4 /* r2 = length again */
ldmeqdb fp, {fp, sp, pc} ldmdbeq fp, {fp, sp, pc}
cmp r2, #2 cmp r2, #2
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0] strb r3, [r0]
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0] strbge r3, [r0]
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0] strbgt r3, [r0]
ldmdb fp, {fp, sp, pc} ldmdb fp, {fp, sp, pc}
END(write_multi_1) END(write_multi_1)

View File

@ -46,6 +46,7 @@
#include "assym.s" #include "assym.s"
__FBSDID("$FreeBSD$"); __FBSDID("$FreeBSD$");
.syntax unified
/* /*
* int in_cksum(struct mbuf *m, int len) * int in_cksum(struct mbuf *m, int len)
* *
@ -128,9 +129,9 @@ ASENTRY_NP(L_cksumdata)
blt .Lcksumdata_endgame blt .Lcksumdata_endgame
cmp r7, #0x02 cmp r7, #0x02
ldrb r4, [r0], #0x01 /* Fetch 1st byte */ ldrb r4, [r0], #0x01 /* Fetch 1st byte */
ldrgeb r5, [r0], #0x01 /* Fetch 2nd byte */ ldrbge r5, [r0], #0x01 /* Fetch 2nd byte */
movlt r5, #0x00 movlt r5, #0x00
ldrgtb r6, [r0], #0x01 /* Fetch 3rd byte */ ldrbgt r6, [r0], #0x01 /* Fetch 3rd byte */
movle r6, #0x00 movle r6, #0x00
/* Combine the three bytes depending on endianness and alignment */ /* Combine the three bytes depending on endianness and alignment */
#ifdef __ARMEB__ #ifdef __ARMEB__
@ -196,7 +197,7 @@ ASENTRY_NP(L_cksumdata)
adcs r2, r2, r5 adcs r2, r2, r5
adc r2, r2, #0x00 adc r2, r2, #0x00
subs r1, r1, #0x40 subs r1, r1, #0x40
ldrged r4, [r0], #0x08 ldrdge r4, [r0], #0x08
bge .Lcksumdata_bigloop bge .Lcksumdata_bigloop
adds r2, r2, r6 /* r6/r7 still need summing */ adds r2, r2, r6 /* r6/r7 still need summing */
@ -241,7 +242,7 @@ ASENTRY_NP(L_cksumdata)
cmp r1, #0x20 cmp r1, #0x20
#ifdef _ARM_ARCH_5E #ifdef _ARM_ARCH_5E
ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */ ldrdge r4, [r0], #0x08 /* Avoid stalling pld and result */
blt .Lcksumdata_less_than_32 blt .Lcksumdata_less_than_32
pld [r0, #0x18] pld [r0, #0x18]
ldrd r6, [r0], #0x08 ldrd r6, [r0], #0x08
@ -319,9 +320,9 @@ ASENTRY_NP(L_cksumdata)
.Lcksumdata_endgame: .Lcksumdata_endgame:
ldrb r3, [r0] /* Fetch first byte */ ldrb r3, [r0] /* Fetch first byte */
cmp r1, #0x02 cmp r1, #0x02
ldrgeb r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ ldrbge r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */
movlt r4, #0x00 movlt r4, #0x00
ldrgtb r5, [r0, #0x02] ldrbgt r5, [r0, #0x02]
movle r5, #0x00 movle r5, #0x00
/* Combine the three bytes depending on endianness and alignment */ /* Combine the three bytes depending on endianness and alignment */
tst r0, #0x01 tst r0, #0x01

View File

@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$");
#include "assym.s" #include "assym.s"
.syntax unified
.L_arm_memcpy: .L_arm_memcpy:
.word _C_LABEL(_arm_memcpy) .word _C_LABEL(_arm_memcpy)
.L_arm_bzero: .L_arm_bzero:
@ -167,39 +169,39 @@ do_memset:
.Lmemset_loop128: .Lmemset_loop128:
subs r1, r1, #0x80 subs r1, r1, #0x80
#ifdef _ARM_ARCH_5E #ifdef _ARM_ARCH_5E
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
#else #else
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
#endif #endif
bgt .Lmemset_loop128 bgt .Lmemset_loop128
RETeq /* Zero length so just exit */ RETeq /* Zero length so just exit */
@ -210,15 +212,15 @@ do_memset:
.Lmemset_loop32: .Lmemset_loop32:
subs r1, r1, #0x20 subs r1, r1, #0x20
#ifdef _ARM_ARCH_5E #ifdef _ARM_ARCH_5E
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
#else #else
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
#endif #endif
bgt .Lmemset_loop32 bgt .Lmemset_loop32
RETeq /* Zero length so just exit */ RETeq /* Zero length so just exit */
@ -227,11 +229,11 @@ do_memset:
/* Deal with 16 bytes or more */ /* Deal with 16 bytes or more */
#ifdef _ARM_ARCH_5E #ifdef _ARM_ARCH_5E
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
strged r2, [ip], #0x08 strdge r2, [ip], #0x08
#else #else
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
stmgeia ip!, {r2-r3} stmiage ip!, {r2-r3}
#endif #endif
RETeq /* Zero length so just exit */ RETeq /* Zero length so just exit */
@ -254,17 +256,17 @@ do_memset:
#endif #endif
strb r3, [ip], #0x01 /* Set 1 byte */ strb r3, [ip], #0x01 /* Set 1 byte */
strgeb r3, [ip], #0x01 /* Set another byte */ strbge r3, [ip], #0x01 /* Set another byte */
strgtb r3, [ip] /* and a third */ strbgt r3, [ip] /* and a third */
RET /* Exit */ RET /* Exit */
.Lmemset_wordunaligned: .Lmemset_wordunaligned:
rsb r2, r2, #0x004 rsb r2, r2, #0x004
strb r3, [ip], #0x01 /* Set 1 byte */ strb r3, [ip], #0x01 /* Set 1 byte */
cmp r2, #0x02 cmp r2, #0x02
strgeb r3, [ip], #0x01 /* Set another byte */ strbge r3, [ip], #0x01 /* Set another byte */
sub r1, r1, r2 sub r1, r1, r2
strgtb r3, [ip], #0x01 /* and a third */ strbgt r3, [ip], #0x01 /* and a third */
cmp r1, #0x04 /* More than 4 bytes left? */ cmp r1, #0x04 /* More than 4 bytes left? */
bge .Lmemset_wordaligned /* Yup */ bge .Lmemset_wordaligned /* Yup */
@ -273,10 +275,11 @@ do_memset:
RETeq /* Zero length so exit */ RETeq /* Zero length so exit */
strb r3, [ip], #0x01 /* Set 1 byte */ strb r3, [ip], #0x01 /* Set 1 byte */
cmp r1, #0x02 cmp r1, #0x02
strgeb r3, [ip], #0x01 /* Set another byte */ strbge r3, [ip], #0x01 /* Set another byte */
strgtb r3, [ip] /* and a third */ strbgt r3, [ip] /* and a third */
RET /* Exit */ RET /* Exit */
END(memset) EEND(memset)
END(bzero)
ENTRY(bcmp) ENTRY(bcmp)
mov ip, r0 mov ip, r0
@ -286,7 +289,7 @@ ENTRY(bcmp)
/* Are both addresses aligned the same way? */ /* Are both addresses aligned the same way? */
cmp r2, #0x00 cmp r2, #0x00
eornes r3, ip, r1 eorsne r3, ip, r1
RETeq /* len == 0, or same addresses! */ RETeq /* len == 0, or same addresses! */
tst r3, #0x03 tst r3, #0x03
subne r2, r2, #0x01 subne r2, r2, #0x01
@ -366,23 +369,23 @@ ENTRY(bcmp)
ldrb r0, [ip, #0x00] /* r0 = b1#0 */ ldrb r0, [ip, #0x00] /* r0 = b1#0 */
ldrb r2, [r1, #0x01] /* r2 = b2#1 */ ldrb r2, [r1, #0x01] /* r2 = b2#1 */
subs r0, r0, r3 /* r0 = b1#0 - b2#0 */ subs r0, r0, r3 /* r0 = b1#0 - b2#0 */
ldreqb r3, [ip, #0x01] /* r3 = b1#1 */ ldrbeq r3, [ip, #0x01] /* r3 = b1#1 */
RETne /* Return if mismatch on #0 */ RETne /* Return if mismatch on #0 */
subs r0, r3, r2 /* r0 = b1#1 - b2#1 */ subs r0, r3, r2 /* r0 = b1#1 - b2#1 */
ldreqb r3, [r1, #0x02] /* r3 = b2#2 */ ldrbeq r3, [r1, #0x02] /* r3 = b2#2 */
ldreqb r0, [ip, #0x02] /* r0 = b1#2 */ ldrbeq r0, [ip, #0x02] /* r0 = b1#2 */
RETne /* Return if mismatch on #1 */ RETne /* Return if mismatch on #1 */
ldrb r2, [r1, #0x03] /* r2 = b2#3 */ ldrb r2, [r1, #0x03] /* r2 = b2#3 */
subs r0, r0, r3 /* r0 = b1#2 - b2#2 */ subs r0, r0, r3 /* r0 = b1#2 - b2#2 */
ldreqb r3, [ip, #0x03] /* r3 = b1#3 */ ldrbeq r3, [ip, #0x03] /* r3 = b1#3 */
RETne /* Return if mismatch on #2 */ RETne /* Return if mismatch on #2 */
subs r0, r3, r2 /* r0 = b1#3 - b2#3 */ subs r0, r3, r2 /* r0 = b1#3 - b2#3 */
ldreqb r3, [r1, #0x04] /* r3 = b2#4 */ ldrbeq r3, [r1, #0x04] /* r3 = b2#4 */
ldreqb r0, [ip, #0x04] /* r0 = b1#4 */ ldrbeq r0, [ip, #0x04] /* r0 = b1#4 */
RETne /* Return if mismatch on #3 */ RETne /* Return if mismatch on #3 */
ldrb r2, [r1, #0x05] /* r2 = b2#5 */ ldrb r2, [r1, #0x05] /* r2 = b2#5 */
subs r0, r0, r3 /* r0 = b1#4 - b2#4 */ subs r0, r0, r3 /* r0 = b1#4 - b2#4 */
ldreqb r3, [ip, #0x05] /* r3 = b1#5 */ ldrbeq r3, [ip, #0x05] /* r3 = b1#5 */
RETne /* Return if mismatch on #4 */ RETne /* Return if mismatch on #4 */
sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ sub r0, r3, r2 /* r0 = b1#5 - b2#5 */
RET RET
@ -436,8 +439,8 @@ EENTRY(memmove)
bge .Lmemmove_floop32 bge .Lmemmove_floop32
cmn r2, #0x10 cmn r2, #0x10
ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
stmgeia r0!, {r3, r4, r12, lr} stmiage r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10 subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */ ldmia sp!, {r4} /* return r4 */
@ -446,9 +449,9 @@ EENTRY(memmove)
/* blat 12 bytes at a time */ /* blat 12 bytes at a time */
.Lmemmove_floop12: .Lmemmove_floop12:
ldmgeia r1!, {r3, r12, lr} ldmiage r1!, {r3, r12, lr}
stmgeia r0!, {r3, r12, lr} stmiage r0!, {r3, r12, lr}
subges r2, r2, #0x0c subsge r2, r2, #0x0c
bge .Lmemmove_floop12 bge .Lmemmove_floop12
.Lmemmove_fl12: .Lmemmove_fl12:
@ -458,23 +461,23 @@ EENTRY(memmove)
subs r2, r2, #4 subs r2, r2, #4
ldrlt r3, [r1], #4 ldrlt r3, [r1], #4
strlt r3, [r0], #4 strlt r3, [r0], #4
ldmgeia r1!, {r3, r12} ldmiage r1!, {r3, r12}
stmgeia r0!, {r3, r12} stmiage r0!, {r3, r12}
subge r2, r2, #4 subge r2, r2, #4
.Lmemmove_fl4: .Lmemmove_fl4:
/* less than 4 bytes to go */ /* less than 4 bytes to go */
adds r2, r2, #4 adds r2, r2, #4
ldmeqia sp!, {r0, pc} /* done */ ldmiaeq sp!, {r0, pc} /* done */
/* copy the crud byte at a time */ /* copy the crud byte at a time */
cmp r2, #2 cmp r2, #2
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0], #1 strb r3, [r0], #1
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0], #1 strbge r3, [r0], #1
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0], #1 strbgt r3, [r0], #1
ldmia sp!, {r0, pc} ldmia sp!, {r0, pc}
/* erg - unaligned destination */ /* erg - unaligned destination */
@ -485,10 +488,10 @@ EENTRY(memmove)
/* align destination with byte copies */ /* align destination with byte copies */
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0], #1 strb r3, [r0], #1
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0], #1 strbge r3, [r0], #1
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0], #1 strbgt r3, [r0], #1
subs r2, r2, r12 subs r2, r2, r12
blt .Lmemmove_fl4 /* less the 4 bytes */ blt .Lmemmove_fl4 /* less the 4 bytes */
@ -703,12 +706,12 @@ EENTRY(memmove)
.Lmemmove_bl32: .Lmemmove_bl32:
cmn r2, #0x10 cmn r2, #0x10
ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
stmgedb r0!, {r3, r4, r12, lr} stmdbge r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10 subge r2, r2, #0x10
adds r2, r2, #0x14 adds r2, r2, #0x14
ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
stmgedb r0!, {r3, r12, lr} stmdbge r0!, {r3, r12, lr}
subge r2, r2, #0x0c subge r2, r2, #0x0c
ldmia sp!, {r4, lr} ldmia sp!, {r4, lr}
@ -718,8 +721,8 @@ EENTRY(memmove)
subs r2, r2, #4 subs r2, r2, #4
ldrlt r3, [r1, #-4]! ldrlt r3, [r1, #-4]!
strlt r3, [r0, #-4]! strlt r3, [r0, #-4]!
ldmgedb r1!, {r3, r12} ldmdbge r1!, {r3, r12}
stmgedb r0!, {r3, r12} stmdbge r0!, {r3, r12}
subge r2, r2, #4 subge r2, r2, #4
.Lmemmove_bl4: .Lmemmove_bl4:
@ -731,10 +734,10 @@ EENTRY(memmove)
cmp r2, #2 cmp r2, #2
ldrb r3, [r1, #-1]! ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]! strb r3, [r0, #-1]!
ldrgeb r3, [r1, #-1]! ldrbge r3, [r1, #-1]!
strgeb r3, [r0, #-1]! strbge r3, [r0, #-1]!
ldrgtb r3, [r1, #-1]! ldrbgt r3, [r1, #-1]!
strgtb r3, [r0, #-1]! strbgt r3, [r0, #-1]!
RET RET
/* erg - unaligned destination */ /* erg - unaligned destination */
@ -744,10 +747,10 @@ EENTRY(memmove)
/* align destination with byte copies */ /* align destination with byte copies */
ldrb r3, [r1, #-1]! ldrb r3, [r1, #-1]!
strb r3, [r0, #-1]! strb r3, [r0, #-1]!
ldrgeb r3, [r1, #-1]! ldrbge r3, [r1, #-1]!
strgeb r3, [r0, #-1]! strbge r3, [r0, #-1]!
ldrgtb r3, [r1, #-1]! ldrbgt r3, [r1, #-1]!
strgtb r3, [r0, #-1]! strbgt r3, [r0, #-1]!
subs r2, r2, r12 subs r2, r2, r12
blt .Lmemmove_bl4 /* less than 4 bytes to go */ blt .Lmemmove_bl4 /* less than 4 bytes to go */
ands r12, r1, #3 ands r12, r1, #3
@ -994,8 +997,8 @@ ENTRY(memcpy)
bge .Lmemcpy_loop32 bge .Lmemcpy_loop32
cmn r2, #0x10 cmn r2, #0x10
ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
stmgeia r0!, {r3, r4, r12, lr} stmiage r0!, {r3, r4, r12, lr}
subge r2, r2, #0x10 subge r2, r2, #0x10
ldmia sp!, {r4} /* return r4 */ ldmia sp!, {r4} /* return r4 */
@ -1004,9 +1007,9 @@ ENTRY(memcpy)
/* blat 12 bytes at a time */ /* blat 12 bytes at a time */
.Lmemcpy_loop12: .Lmemcpy_loop12:
ldmgeia r1!, {r3, r12, lr} ldmiage r1!, {r3, r12, lr}
stmgeia r0!, {r3, r12, lr} stmiage r0!, {r3, r12, lr}
subges r2, r2, #0x0c subsge r2, r2, #0x0c
bge .Lmemcpy_loop12 bge .Lmemcpy_loop12
.Lmemcpy_l12: .Lmemcpy_l12:
@ -1016,26 +1019,26 @@ ENTRY(memcpy)
subs r2, r2, #4 subs r2, r2, #4
ldrlt r3, [r1], #4 ldrlt r3, [r1], #4
strlt r3, [r0], #4 strlt r3, [r0], #4
ldmgeia r1!, {r3, r12} ldmiage r1!, {r3, r12}
stmgeia r0!, {r3, r12} stmiage r0!, {r3, r12}
subge r2, r2, #4 subge r2, r2, #4
.Lmemcpy_l4: .Lmemcpy_l4:
/* less than 4 bytes to go */ /* less than 4 bytes to go */
adds r2, r2, #4 adds r2, r2, #4
#ifdef __APCS_26_ #ifdef __APCS_26_
ldmeqia sp!, {r0, pc}^ /* done */ ldmiaeq sp!, {r0, pc}^ /* done */
#else #else
ldmeqia sp!, {r0, pc} /* done */ ldmiaeq sp!, {r0, pc} /* done */
#endif #endif
/* copy the crud byte at a time */ /* copy the crud byte at a time */
cmp r2, #2 cmp r2, #2
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0], #1 strb r3, [r0], #1
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0], #1 strbge r3, [r0], #1
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0], #1 strbgt r3, [r0], #1
ldmia sp!, {r0, pc} ldmia sp!, {r0, pc}
/* erg - unaligned destination */ /* erg - unaligned destination */
@ -1046,10 +1049,10 @@ ENTRY(memcpy)
/* align destination with byte copies */ /* align destination with byte copies */
ldrb r3, [r1], #1 ldrb r3, [r1], #1
strb r3, [r0], #1 strb r3, [r0], #1
ldrgeb r3, [r1], #1 ldrbge r3, [r1], #1
strgeb r3, [r0], #1 strbge r3, [r0], #1
ldrgtb r3, [r1], #1 ldrbgt r3, [r1], #1
strgtb r3, [r0], #1 strbgt r3, [r0], #1
subs r2, r2, r12 subs r2, r2, r12
blt .Lmemcpy_l4 /* less the 4 bytes */ blt .Lmemcpy_l4 /* less the 4 bytes */
@ -1212,12 +1215,12 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01 ldrb ip, [r1], #0x01
sub r2, r2, #0x01 sub r2, r2, #0x01
strb ip, [r3], #0x01 strb ip, [r3], #0x01
ldrleb ip, [r1], #0x01 ldrble ip, [r1], #0x01
suble r2, r2, #0x01 suble r2, r2, #0x01
strleb ip, [r3], #0x01 strble ip, [r3], #0x01
ldrltb ip, [r1], #0x01 ldrblt ip, [r1], #0x01
sublt r2, r2, #0x01 sublt r2, r2, #0x01
strltb ip, [r3], #0x01 strblt ip, [r3], #0x01
/* Destination buffer is now word aligned */ /* Destination buffer is now word aligned */
.Lmemcpy_wordaligned: .Lmemcpy_wordaligned:
@ -1294,7 +1297,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan128: .Lmemcpy_w_lessthan128:
adds r2, r2, #0x80 /* Adjust for extra sub */ adds r2, r2, #0x80 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x20 subs r2, r2, #0x20
blt .Lmemcpy_w_lessthan32 blt .Lmemcpy_w_lessthan32
@ -1319,7 +1322,7 @@ ENTRY(memcpy)
.Lmemcpy_w_lessthan32: .Lmemcpy_w_lessthan32:
adds r2, r2, #0x20 /* Adjust for extra sub */ adds r2, r2, #0x20 /* Adjust for extra sub */
ldmeqfd sp!, {r4-r9} ldmfdeq sp!, {r4-r9}
RETeq /* Return now if done */ RETeq /* Return now if done */
and r4, r2, #0x18 and r4, r2, #0x18
@ -1355,11 +1358,11 @@ ENTRY(memcpy)
addlt r2, r2, #0x04 addlt r2, r2, #0x04
ldrb ip, [r1], #0x01 ldrb ip, [r1], #0x01
cmp r2, #0x02 cmp r2, #0x02
ldrgeb r2, [r1], #0x01 ldrbge r2, [r1], #0x01
strb ip, [r3], #0x01 strb ip, [r3], #0x01
ldrgtb ip, [r1] ldrbgt ip, [r1]
strgeb r2, [r3], #0x01 strbge r2, [r3], #0x01
strgtb ip, [r3] strbgt ip, [r3]
RET RET
@ -1413,7 +1416,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad1_loop16 bge .Lmemcpy_bad1_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r1, r1, #0x03 sublt r1, r1, #0x03
@ -1474,7 +1477,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad2_loop16 bge .Lmemcpy_bad2_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r1, r1, #0x02 sublt r1, r1, #0x02
@ -1535,7 +1538,7 @@ ENTRY(memcpy)
bge .Lmemcpy_bad3_loop16 bge .Lmemcpy_bad3_loop16
adds r2, r2, #0x10 adds r2, r2, #0x10
ldmeqfd sp!, {r4-r7} ldmfdeq sp!, {r4-r7}
RETeq /* Return now if done */ RETeq /* Return now if done */
subs r2, r2, #0x04 subs r2, r2, #0x04
sublt r1, r1, #0x01 sublt r1, r1, #0x01
@ -1564,11 +1567,11 @@ ENTRY(memcpy)
RETeq RETeq
ldrb ip, [r1], #0x01 ldrb ip, [r1], #0x01
cmp r2, #0x02 cmp r2, #0x02
ldrgeb r2, [r1], #0x01 ldrbge r2, [r1], #0x01
strb ip, [r3], #0x01 strb ip, [r3], #0x01
ldrgtb ip, [r1] ldrbgt ip, [r1]
strgeb r2, [r3], #0x01 strbge r2, [r3], #0x01
strgtb ip, [r3] strbgt ip, [r3]
RET RET
@ -1598,7 +1601,7 @@ ENTRY(memcpy)
ldrb ip, [r1], #0x01 ldrb ip, [r1], #0x01
1: subs r2, r2, #0x01 1: subs r2, r2, #0x01
strb ip, [r3], #0x01 strb ip, [r3], #0x01
ldrneb ip, [r1], #0x01 ldrbne ip, [r1], #0x01
bne 1b bne 1b
RET RET