diff options
| author | Quan Yong Zhai <qyzhai@gmail.com> | 2011-07-12 17:30:40 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-07-12 17:30:40 -0700 |
| commit | fe9991e8b29d261f12a0a0a15b89d67a29f5299d (patch) | |
| tree | dd74907d74aaa2513d6133a9e693ca5cc43dcdcb /src/pkg/runtime/amd64 | |
| parent | ba91dac3a9e01a68e13e3ea6f6798f2f3b4ea73f (diff) | |
| download | go-fe9991e8b29d261f12a0a0a15b89d67a29f5299d.tar.xz | |
runtime: replace runtime.mcpy with runtime.memmove
faster string operations, and more
tested on linux/386
runtime_test.BenchmarkSliceToString 642 532 -17.13%
runtime_test.BenchmarkStringToSlice 636 528 -16.98%
runtime_test.BenchmarkConcatString 1109 897 -19.12%
R=r, iant, rsc
CC=golang-dev
https://golang.org/cl/4674042
Diffstat (limited to 'src/pkg/runtime/amd64')
| -rw-r--r-- | src/pkg/runtime/amd64/closure.c | 2 | ||||
| -rw-r--r-- | src/pkg/runtime/amd64/memmove.s | 11 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/pkg/runtime/amd64/closure.c b/src/pkg/runtime/amd64/closure.c index 5033468d28..481b4a8882 100644 --- a/src/pkg/runtime/amd64/closure.c +++ b/src/pkg/runtime/amd64/closure.c @@ -45,7 +45,7 @@ runtime·closure(int32 siz, byte *fn, byte *arg0) q = p + n - siz; if(siz > 0) { - runtime·mcpy(q, (byte*)&arg0, siz); + runtime·memmove(q, (byte*)&arg0, siz); // SUBQ $siz, SP *p++ = 0x48; diff --git a/src/pkg/runtime/amd64/memmove.s b/src/pkg/runtime/amd64/memmove.s index fc9573f72e..e78be81455 100644 --- a/src/pkg/runtime/amd64/memmove.s +++ b/src/pkg/runtime/amd64/memmove.s @@ -28,8 +28,6 @@ TEXT runtime·memmove(SB), 7, $0 MOVQ to+0(FP), DI MOVQ fr+8(FP), SI MOVLQSX n+16(FP), BX - CMPQ BX, $0 - JLT fault /* * check and set for backwards @@ -88,12 +86,3 @@ back: MOVQ to+0(FP),AX RET -/* - * if called with negative count, - * treat as error rather than - * rotating all of memory - */ -fault: - MOVQ $0,SI - MOVQ 0(SI), AX - RET |
