diff options
author | Kai Backman <kaib@golang.org> | 2009-12-10 11:42:01 -0800 |
---|---|---|
committer | Kai Backman <kaib@golang.org> | 2009-12-10 11:42:01 -0800 |
commit | ae780b04f41ac629f07bf3561240c5e89e7004bb (patch) | |
tree | 7a2c42c458e2bea67ae27ba6a7c0cfe7b2b73935 | |
parent | 1243f66753e4001a905896756fe46d63fc8155c0 (diff) | |
download | golang-ae780b04f41ac629f07bf3561240c5e89e7004bb.tar.gz |
fix calling convention and make memmove restore the g and m
registers.
R=rsc
http://codereview.appspot.com/166049
-rw-r--r-- | src/pkg/runtime/arm/memmove.s | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/pkg/runtime/arm/memmove.s b/src/pkg/runtime/arm/memmove.s index bf172680c..9f7dc1dd2 100644 --- a/src/pkg/runtime/arm/memmove.s +++ b/src/pkg/runtime/arm/memmove.s @@ -30,9 +30,14 @@ N = 3 TMP = 3 /* N and TMP don't overlap */ TMP1 = 4 -TEXT memmove(SB), 7, $-4 +// TODO(kaib): This can be done with the existing registers of LR is re-used. Same for memset. +TEXT memmove(SB), 7, $8 + // save g and m + MOVW R9, 4(R13) + MOVW R10, 8(R13) + _memmove: - MOVW R(TS), to+0(FP) /* need to save for return value */ + MOVW to+0(FP), R(TS) MOVW from+4(FP), R(FROM) MOVW n+8(FP), R(N) @@ -129,6 +134,9 @@ _f1tail: B _f1tail _return: + // restore g and m + MOVW 4(R13), R9 + MOVW 8(R13), R10 MOVW to+0(FP), R0 RET |