1
0
mirror of https://github.com/golang/go synced 2024-11-20 01:14:40 -07:00
go/src/runtime/memclr_ppc64x.s
Michael Hudson-Doyle 45c06b27a4 cmd/internal/obj, runtime: add NOFRAME flag to suppress stack frame set up on ppc64x
Replace the confusing game where a frame size of $-8 would suppress the
implicit setting up of a stack frame with a nice explicit flag.

The code to set up the function prologue is still a little confusing but better
than it was.

Change-Id: I1d49278ff42c6bc734ebfb079998b32bc53f8d9a
Reviewed-on: https://go-review.googlesource.com/15670
Reviewed-by: Minux Ma <minux@golang.org>
2015-10-18 22:13:30 +00:00

32 lines
646 B
ArmAsm

// Copyright 2014 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.
// +build ppc64 ppc64le
#include "textflag.h"
// void runtime·memclr(void*, uintptr)
TEXT runtime·memclr(SB),NOSPLIT|NOFRAME,$0-16
MOVD ptr+0(FP), R3
MOVD n+8(FP), R4
SRADCC $3, R4, R6 // R6 is the number of words to zero
BEQ bytes
SUB $8, R3
MOVD R6, CTR
MOVDU R0, 8(R3)
BC 25, 0, -1(PC) // bdnz+ $-4
ADD $8, R3
bytes:
ANDCC $7, R4, R7 // R7 is the number of bytes to zero
BEQ done
SUB $1, R3
MOVD R7, CTR
MOVBU R0, 1(R3)
BC 25, 0, -1(PC) // bdnz+ $-4
done:
RET