]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: cleanup amd64p32 memmove and memclr file organization
authorMartin Möhrmann <moehrmann@google.com>
Sat, 2 Sep 2017 06:33:21 +0000 (08:33 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Tue, 5 Sep 2017 20:00:05 +0000 (20:00 +0000)
Move memclr to a separate file to make it consistent
with other platforms asm function to file organization.

Remove nacl from the memmove filename as the implementation
is generic for the amd64p32 platform even if currently only
nacl is supported for amd64p32.

Change-Id: I8930b76da430a5cf2664801974e4f5185fc0f82f
Reviewed-on: https://go-review.googlesource.com/61031
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/asm_amd64p32.s
src/runtime/memclr_amd64p32.s [new file with mode: 0644]
src/runtime/memmove_amd64p32.s [moved from src/runtime/memmove_nacl_amd64p32.s with 100% similarity]

index f9417196c594f174c97f98da0000b535324c43fb..6777ad03b9793f4c7aad39dacdbbaf106bb35354 100644 (file)
@@ -559,24 +559,6 @@ TEXT runtime·stackcheck(SB), NOSPLIT, $0-0
        MOVL    0, AX
        RET
 
-TEXT runtime·memclrNoHeapPointers(SB),NOSPLIT,$0-8
-       MOVL    ptr+0(FP), DI
-       MOVL    n+4(FP), CX
-       MOVQ    CX, BX
-       ANDQ    $3, BX
-       SHRQ    $2, CX
-       MOVQ    $0, AX
-       CLD
-       REP
-       STOSL
-       MOVQ    BX, CX
-       REP
-       STOSB
-       // Note: we zero only 4 bytes at a time so that the tail is at most
-       // 3 bytes. That guarantees that we aren't zeroing pointers with STOSB.
-       // See issue 13160.
-       RET
-
 TEXT runtime·getcallerpc(SB),NOSPLIT,$8-12
        MOVL    argp+0(FP),AX           // addr of first arg
        MOVL    -8(AX),AX               // get calling pc
diff --git a/src/runtime/memclr_amd64p32.s b/src/runtime/memclr_amd64p32.s
new file mode 100644 (file)
index 0000000..26171bf
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "textflag.h"
+
+TEXT runtime·memclrNoHeapPointers(SB),NOSPLIT,$0-8
+       MOVL    ptr+0(FP), DI
+       MOVL    n+4(FP), CX
+       MOVQ    CX, BX
+       ANDQ    $3, BX
+       SHRQ    $2, CX
+       MOVQ    $0, AX
+       CLD
+       REP
+       STOSL
+       MOVQ    BX, CX
+       REP
+       STOSB
+       // Note: we zero only 4 bytes at a time so that the tail is at most
+       // 3 bytes. That guarantees that we aren't zeroing pointers with STOSB.
+       // See issue 13160.
+       RET