summaryrefslogtreecommitdiff
path: root/libc/string/sh/sh4/memcpy.S
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2010-12-14 14:50:49 +0100
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-12-14 14:54:26 +0100
commite018b8ba1a0110120429de34366459af0771abe2 (patch)
treecc38652121c59fdf43e94ccc3d13b62bdc481338 /libc/string/sh/sh4/memcpy.S
parentd181797c70183b897330a290e6f5f5d7e7812770 (diff)
parent640220faf25659eb4c15b78cf8869251dbadbd16 (diff)
Merge commit 'origin/master' into prelink
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/string/sh/sh4/memcpy.S')
-rw-r--r--libc/string/sh/sh4/memcpy.S18
1 files changed, 15 insertions, 3 deletions
diff --git a/libc/string/sh/sh4/memcpy.S b/libc/string/sh/sh4/memcpy.S
index 5be770a59..6a229a06c 100644
--- a/libc/string/sh/sh4/memcpy.S
+++ b/libc/string/sh/sh4/memcpy.S
@@ -497,6 +497,12 @@ ENTRY(memcpy)
mov r5, r6
add #-0x80, r6 ! prefetch head
+ ! store FPU (in single precision mode, do not check R15 align).
+ fmov fr12, @-r15
+ fmov fr13, @-r15
+ fmov fr14, @-r15
+ fmov fr15, @-r15
+
FPU_SET_PAIRED_PREC
mov #4, r0
@@ -553,16 +559,22 @@ ENTRY(memcpy)
bt/s 67b
pref @r6
+ RESTORE_FPSCR
+
+ ! Restore FPU callee save registers
+ fmov @r15+, fr15
+ fmov @r15+, fr14
+ fmov @r15+, fr13
+ fmov @r15+, fr12
+
! Other cache lines could be copied: so use the FPU in single paired
! precision without prefetching. No check for alignment is necessary.
mov #1, r0
cmp/ge r0, r3
- bt/s 4f
+ bt/s 3f
add #0x60, r5
- RESTORE_FPSCR
-
bra 5f
nop