aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChitti Babu Theegala <ctheegal@codeaurora.org>2017-01-12 18:37:18 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-01-12 18:37:18 +0000
commite360a1c8a389772718814d291978390e0b662805 (patch)
treecd89b3463369f42de2e49ab1cc1f148ade40adcd
parentca55343859fd1f636cf37fe65461450282558da6 (diff)
parentb7ec7cac7d48f314e5a49d727f97e23c34f9a88c (diff)
downloadbionic-nougat-mr2-dev.tar.gz
am: b7ec7cac7d Change-Id: I4f832430c4c473d76934511c2cf4ec2fbe4d0bc3
-rw-r--r--libc/arch-arm/cortex-a7/bionic/memcpy_base.S28
1 files changed, 25 insertions, 3 deletions
diff --git a/libc/arch-arm/cortex-a7/bionic/memcpy_base.S b/libc/arch-arm/cortex-a7/bionic/memcpy_base.S
index 1d152bbc1..4ff982b0f 100644
--- a/libc/arch-arm/cortex-a7/bionic/memcpy_base.S
+++ b/libc/arch-arm/cortex-a7/bionic/memcpy_base.S
@@ -101,16 +101,38 @@
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]!
-2: // Make sure we have at least 64 bytes to copy.
+2: cmp r2, #256
+ ble .L_copy_loop
+
+ // Make sure DST is 64 BYTE aligned.
+ rsb r3, r0, #0
+ ands r3, r3, #0x30
+ beq .L_copy_loop
+
+ sub r2, r2, r3
+ cmp r3, #0x10
+ beq .L_copy_16
+
+ vld1.8 {d0 - d3}, [r1]!
+ vst1.8 {d0 - d3}, [r0, :128]!
+ ands r3, r3, #0x10
+ beq .L_copy_loop
+
+.L_copy_16:
+ vld1.8 {d0, d1}, [r1]!
+ vst1.8 {d0, d1}, [r0, :128]!
+
+.L_copy_loop:
+ // Make sure we have at least 64 bytes to copy.
subs r2, r2, #64
blo 2f
1: // The main loop copies 64 bytes at a time.
vld1.8 {d0 - d3}, [r1]!
- vld1.8 {d4 - d7}, [r1]!
+ vst1.8 {d0 - d3}, [r0, :128]!
pld [r1, #(64*4)]
subs r2, r2, #64
- vst1.8 {d0 - d3}, [r0, :128]!
+ vld1.8 {d4 - d7}, [r1]!
vst1.8 {d4 - d7}, [r0, :128]!
bhs 1b