aboutsummaryrefslogtreecommitdiff
path: root/ports/sysdeps/arm/memcpy.S
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2013-03-15 09:31:56 -0700
committerRoland McGrath <roland@hack.frob.com>2013-03-15 09:31:56 -0700
commita7ac752299cb61f3140ab76c6f0a4ed46f52df55 (patch)
tree52798d8cb03569a69f00b7950dfdbf226415ca09 /ports/sysdeps/arm/memcpy.S
parentef26eece6331a1f6d959818e37c438cc7ce68e53 (diff)
downloadglibc-a7ac752299cb61f3140ab76c6f0a4ed46f52df55.zip
glibc-a7ac752299cb61f3140ab76c6f0a4ed46f52df55.tar.gz
glibc-a7ac752299cb61f3140ab76c6f0a4ed46f52df55.tar.bz2
ARM: sfi_breg assembler macro
Diffstat (limited to 'ports/sysdeps/arm/memcpy.S')
-rw-r--r--ports/sysdeps/arm/memcpy.S124
1 files changed, 79 insertions, 45 deletions
diff --git a/ports/sysdeps/arm/memcpy.S b/ports/sysdeps/arm/memcpy.S
index 9265814..add82e2 100644
--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -70,7 +70,7 @@ ENTRY(memcpy)
subs r2, r2, #4
blt 8f
ands ip, r0, #3
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
bne 9f
ands ip, r1, #3
bne 10f
@@ -97,17 +97,19 @@ ENTRY(memcpy)
CALGN( bx r4 )
#endif
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
2: PLD( subs r2, r2, #96 )
- PLD( pld [r1, #28] )
+ PLD( sfi_pld r1, #28 )
PLD( blt 4f )
- PLD( pld [r1, #60] )
- PLD( pld [r1, #92] )
+ PLD( sfi_pld r1, #60 )
+ PLD( sfi_pld r1, #92 )
-3: PLD( pld [r1, #124] )
-4: ldmia r1!, {r3, r4, r5, r6, r7, r8, ip, lr}
+3: PLD( sfi_pld r1, #124 )
+4: sfi_breg r1, \
+ ldmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
subs r2, r2, #32
- stmia r0!, {r3, r4, r5, r6, r7, r8, ip, lr}
+ sfi_breg r0, \
+ stmia \B!, {r3, r4, r5, r6, r7, r8, ip, lr}
bge 3b
PLD( cmn r2, #96 )
PLD( bge 4b )
@@ -129,19 +131,26 @@ ENTRY(memcpy)
.p2align ARM_BX_ALIGN_LOG2
6: nop
.p2align ARM_BX_ALIGN_LOG2
- ldr r3, [r1], #4
+ sfi_breg r1, \
+ ldr r3, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr r4, [r1], #4
+ sfi_breg r1, \
+ ldr r4, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr r5, [r1], #4
+ sfi_breg r1, \
+ ldr r5, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr r6, [r1], #4
+ sfi_breg r1, \
+ ldr r6, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr r7, [r1], #4
+ sfi_breg r1, \
+ ldr r7, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr r8, [r1], #4
+ sfi_breg r1, \
+ ldr r8, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- ldr lr, [r1], #4
+ sfi_breg r1, \
+ ldr lr, [\B], #4
#ifndef ARM_ALWAYS_BX
add pc, pc, ip, lsl #(ARM_BX_ALIGN_LOG2 - 2)
@@ -153,19 +162,26 @@ ENTRY(memcpy)
.p2align ARM_BX_ALIGN_LOG2
nop
.p2align ARM_BX_ALIGN_LOG2
- str r3, [r0], #4
+ sfi_breg r0, \
+ str r3, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str r4, [r0], #4
+ sfi_breg r0, \
+ str r4, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str r5, [r0], #4
+ sfi_breg r0, \
+ str r5, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str r6, [r0], #4
+ sfi_breg r0, \
+ str r6, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str r7, [r0], #4
+ sfi_breg r0, \
+ str r7, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str r8, [r0], #4
+ sfi_breg r0, \
+ str r8, [\B], #4
.p2align ARM_BX_ALIGN_LOG2
- str lr, [r0], #4
+ sfi_breg r0, \
+ str lr, [\B], #4
#ifdef ARM_ALWAYS_BX
pop {r10}
@@ -183,12 +199,18 @@ ENTRY(memcpy)
cfi_restore (r8)
8: movs r2, r2, lsl #31
- ldrbne r3, [r1], #1
- ldrbcs r4, [r1], #1
- ldrbcs ip, [r1]
- strbne r3, [r0], #1
- strbcs r4, [r0], #1
- strbcs ip, [r0]
+ sfi_breg r1, \
+ ldrbne r3, [\B], #1
+ sfi_breg r1, \
+ ldrbcs r4, [\B], #1
+ sfi_breg r1, \
+ ldrbcs ip, [\B]
+ sfi_breg r0, \
+ strbne r3, [\B], #1
+ sfi_breg r0, \
+ strbcs r4, [\B], #1
+ sfi_breg r0, \
+ strbcs ip, [\B]
#if ((defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)) \
|| defined (ARM_ALWAYS_BX))
@@ -205,20 +227,27 @@ ENTRY(memcpy)
9: rsb ip, ip, #4
cmp ip, #2
- ldrbgt r3, [r1], #1
- ldrbge r4, [r1], #1
- ldrb lr, [r1], #1
- strbgt r3, [r0], #1
- strbge r4, [r0], #1
+ sfi_breg r1, \
+ ldrbgt r3, [\B], #1
+ sfi_breg r1, \
+ ldrbge r4, [\B], #1
+ sfi_breg r1, \
+ ldrb lr, [\B], #1
+ sfi_breg r0, \
+ strbgt r3, [\B], #1
+ sfi_breg r0, \
+ strbge r4, [\B], #1
subs r2, r2, ip
- strb lr, [r0], #1
+ sfi_breg r0, \
+ strb lr, [\B], #1
blt 8b
ands ip, r1, #3
beq 1b
10: bic r1, r1, #3
cmp ip, #2
- ldr lr, [r1], #4
+ sfi_breg r1, \
+ ldr lr, [\B], #4
beq 17f
bgt 18f
@@ -242,18 +271,20 @@ ENTRY(memcpy)
cfi_rel_offset (r8, 12)
cfi_rel_offset (r10, 16)
- PLD( pld [r1, #0] )
+ PLD( sfi_pld r1, #0 )
PLD( subs r2, r2, #96 )
- PLD( pld [r1, #28] )
+ PLD( sfi_pld r1, #28 )
PLD( blt 13f )
- PLD( pld [r1, #60] )
- PLD( pld [r1, #92] )
+ PLD( sfi_pld r1, #60 )
+ PLD( sfi_pld r1, #92 )
-12: PLD( pld [r1, #124] )
-13: ldmia r1!, {r4, r5, r6, r7}
+12: PLD( sfi_pld r1, #124 )
+13: sfi_breg r1, \
+ ldmia \B!, {r4, r5, r6, r7}
mov r3, lr, PULL #\pull
subs r2, r2, #32
- ldmia r1!, {r8, r10, ip, lr}
+ sfi_breg r1, \
+ ldmia \B!, {r8, r10, ip, lr}
orr r3, r3, r4, PUSH #\push
mov r4, r4, PULL #\pull
orr r4, r4, r5, PUSH #\push
@@ -269,7 +300,8 @@ ENTRY(memcpy)
orr r10, r10, ip, PUSH #\push
mov ip, ip, PULL #\pull
orr ip, ip, lr, PUSH #\push
- stmia r0!, {r3, r4, r5, r6, r7, r8, r10, ip}
+ sfi_breg r0, \
+ stmia \B!, {r3, r4, r5, r6, r7, r8, r10, ip}
bge 12b
PLD( cmn r2, #96 )
PLD( bge 13b )
@@ -286,10 +318,12 @@ ENTRY(memcpy)
beq 16f
15: mov r3, lr, PULL #\pull
- ldr lr, [r1], #4
+ sfi_breg r1, \
+ ldr lr, [\B], #4
subs ip, ip, #4
orr r3, r3, lr, PUSH #\push
- str r3, [r0], #4
+ sfi_breg r0, \
+ str r3, [\B], #4
bgt 15b
CALGN( cmp r2, #0 )
CALGN( bge 11b )