From 6675fadfb880bd0a3fa1d5524819db02d200bda2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20M=C3=B6hrmann?= Date: Sat, 2 Sep 2017 08:33:21 +0200 Subject: [PATCH] runtime: cleanup amd64p32 memmove and memclr file organization MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/runtime/asm_amd64p32.s | 18 --------------- src/runtime/memclr_amd64p32.s | 23 +++++++++++++++++++ ...ove_nacl_amd64p32.s => memmove_amd64p32.s} | 0 3 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 src/runtime/memclr_amd64p32.s rename src/runtime/{memmove_nacl_amd64p32.s => memmove_amd64p32.s} (100%) 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 -- 2.50.0