Use unified syntax to compile with both llvm and gcc.
All arch-arm and arch-arm64 .S files were compiled
by gcc with and without this patch. The output object files
were identical. When compiled with llvm and this patch,
the output files were also identical to gcc's output.
BUG: 18061004
Change-Id: I458914d512ddf5496e4eb3d288bf032cd526d32b
diff --git a/libc/arch-arm/generic/bionic/memset.S b/libc/arch-arm/generic/bionic/memset.S
index be35de9..d17a9c4 100644
--- a/libc/arch-arm/generic/bionic/memset.S
+++ b/libc/arch-arm/generic/bionic/memset.S
@@ -35,6 +35,8 @@
* memset() returns its first argument.
*/
+ .syntax unified
+
ENTRY(__memset_chk)
cmp r2, r3
bls done
@@ -76,11 +78,11 @@
orr r1, r1, r1, lsr #16
movs r12, r3, lsl #31
- strcsb r1, [r0], #1 /* can't use strh (alignment unknown) */
- strcsb r1, [r0], #1
- strmib r1, [r0], #1
+ strbcs r1, [r0], #1 /* can't use strh (alignment unknown) */
+ strbcs r1, [r0], #1
+ strbmi r1, [r0], #1
subs r2, r2, r3
- ldmlsfd sp!, {r0, r4-r7, lr} /* return */
+ popls {r0, r4-r7, lr} /* return */
bxls lr
/* align the destination to a cache-line */
@@ -100,9 +102,9 @@
/* conditionally writes 0 to 7 words (length in r3) */
movs r3, r3, lsl #28
- stmcsia r0!, {r1, lr}
- stmcsia r0!, {r1, lr}
- stmmiia r0!, {r1, lr}
+ stmcs r0!, {r1, lr}
+ stmcs r0!, {r1, lr}
+ stmmi r0!, {r1, lr}
movs r3, r3, lsl #2
strcs r1, [r0], #4
@@ -117,13 +119,13 @@
/* conditionally stores 0 to 31 bytes */
movs r2, r2, lsl #28
- stmcsia r0!, {r1,r3,r12,lr}
- stmmiia r0!, {r1, lr}
+ stmcs r0!, {r1,r3,r12,lr}
+ stmmi r0!, {r1, lr}
movs r2, r2, lsl #2
strcs r1, [r0], #4
- strmih r1, [r0], #2
+ strhmi r1, [r0], #2
movs r2, r2, lsl #2
- strcsb r1, [r0]
+ strbcs r1, [r0]
ldmfd sp!, {r0, r4-r7, lr}
bx lr
END(memset)