github.com/mattn/go@v0.0.0-20171011075504-07f7db3ea99f/src/runtime/memclr_amd64p32.s (about)

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #include "textflag.h"
     6  
     7  TEXT runtime·memclrNoHeapPointers(SB),NOSPLIT,$0-8
     8  	MOVL	ptr+0(FP), DI
     9  	MOVL	n+4(FP), CX
    10  	MOVQ	CX, BX
    11  	ANDQ	$3, BX
    12  	SHRQ	$2, CX
    13  	MOVQ	$0, AX
    14  	CLD
    15  	REP
    16  	STOSL
    17  	MOVQ	BX, CX
    18  	REP
    19  	STOSB
    20  	// Note: we zero only 4 bytes at a time so that the tail is at most
    21  	// 3 bytes. That guarantees that we aren't zeroing pointers with STOSB.
    22  	// See issue 13160.
    23  	RET