From: Martin Möhrmann Date: Sat, 2 Sep 2017 06:33:21 +0000 (+0200) Subject: runtime: cleanup amd64p32 memmove and memclr file organization X-Git-Tag: go1.10beta1~1220 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6675fadfb880bd0a3fa1d5524819db02d200bda2;p=gostls13.git runtime: cleanup amd64p32 memmove and memclr file organization 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- diff --git a/src/runtime/asm_amd64p32.s b/src/runtime/asm_amd64p32.s index f9417196c5..6777ad03b9 100644 --- a/src/runtime/asm_amd64p32.s +++ b/src/runtime/asm_amd64p32.s @@ -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 index 0000000000..26171bfd4a --- /dev/null +++ b/src/runtime/memclr_amd64p32.s @@ -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 diff --git a/src/runtime/memmove_nacl_amd64p32.s b/src/runtime/memmove_amd64p32.s similarity index 100% rename from src/runtime/memmove_nacl_amd64p32.s rename to src/runtime/memmove_amd64p32.s