summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern/arch/arm/memset.S
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2015-06-08 14:22:05 +0000
committerjsg <jsg@openbsd.org>2015-06-08 14:22:05 +0000
commitc6b709f57b9f0eb79d5cd435ebd6ead1f648a81f (patch)
treed34f59e202e510eb4663d503ef0d259fda2a6fd6 /sys/lib/libkern/arch/arm/memset.S
parentMerge multiple copies of the code doing VLAN tag insertion back into (diff)
downloadwireguard-openbsd-c6b709f57b9f0eb79d5cd435ebd6ead1f648a81f.tar.xz
wireguard-openbsd-c6b709f57b9f0eb79d5cd435ebd6ead1f648a81f.zip
At some point arm moved to a unified syntax for arm and thumb instructions.
While binutils supports both "unified" and "divided" syntax (defaulting to divided) the integrated assembler in clang only supports unified names so switch some files to unified syntax. Similiar changes were made in bitrig and freebsd. No difference in objdump -d output. tested on zaurus by deraadt@, ok miod@
Diffstat (limited to 'sys/lib/libkern/arch/arm/memset.S')
-rw-r--r--sys/lib/libkern/arch/arm/memset.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/lib/libkern/arch/arm/memset.S b/sys/lib/libkern/arch/arm/memset.S
index 1635c81f7b9..9497448e98c 100644
--- a/sys/lib/libkern/arch/arm/memset.S
+++ b/sys/lib/libkern/arch/arm/memset.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.S,v 1.3 2014/12/30 08:12:52 jsg Exp $ */
+/* $OpenBSD: memset.S,v 1.4 2015/06/08 14:22:05 jsg Exp $ */
/* $NetBSD: memset.S,v 1.1 2000/12/29 20:51:57 bjh21 Exp $ */
/*
@@ -47,6 +47,8 @@
* r0 - dest address
*/
+.syntax unified
+
ENTRY(memset)
stmfd sp!, {r0} /* Remember address for return value */
and r1, r1, #0x000000ff /* We write bytes */
@@ -63,8 +65,8 @@ ENTRY(memset)
sub r2, r2, r3
cmp r3, #0x00000002
strb r1, [r0], #0x0001 /* Set 1 byte */
- strgeb r1, [r0], #0x0001 /* Set another byte */
- strgtb r1, [r0], #0x0001 /* and a third */
+ strbge r1, [r0], #0x0001 /* Set another byte */
+ strbgt r1, [r0], #0x0001 /* and a third */
cmp r2, #0x00000004
blt Lmemset_lessthanfour
@@ -115,13 +117,13 @@ Lmemset_loop4:
Lmemset_lessthanfour:
cmp r2, #0x00000000
- ldmeqfd sp!, {r0}
+ ldmfdeq sp!, {r0}
moveq pc, lr /* Zero length so exit */
cmp r2, #0x00000002
strb r1, [r0], #0x0001 /* Set 1 byte */
- strgeb r1, [r0], #0x0001 /* Set another byte */
- strgtb r1, [r0], #0x0001 /* and a third */
+ strbge r1, [r0], #0x0001 /* Set another byte */
+ strbgt r1, [r0], #0x0001 /* and a third */
ldmfd sp!, {r0}
mov pc, lr /* Exit */