mirror of
https://github.com/golang/go
synced 2024-11-19 16:14:49 -07:00
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 <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
0fb82fbcce
commit
6675fadfb8
@ -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
|
||||
|
23
src/runtime/memclr_amd64p32.s
Normal file
23
src/runtime/memclr_amd64p32.s
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user