1
0
mirror of https://github.com/golang/go synced 2024-11-20 10:14:43 -07:00
go/src/runtime/memmove_ppc64x.s
Russ Cox 09d92b6bbf all: power64 is now ppc64
Fixes #8654.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/180600043
2014-12-05 19:13:20 -05:00

41 lines
639 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·memmove(void*, void*, uintptr)
TEXT runtime·memmove(SB), NOSPLIT, $-8-24
MOVD to+0(FP), R3
MOVD from+8(FP), R4
MOVD n+16(FP), R5
CMP R5, $0
BNE check
RETURN
check:
CMP R3, R4
BGT backward
SUB $1, R3
ADD R3, R5
SUB $1, R4
loop:
MOVBU 1(R4), R6
MOVBU R6, 1(R3)
CMP R3, R5
BNE loop
RETURN
backward:
ADD R5, R4
ADD R3, R5
loop1:
MOVBU -1(R4), R6
MOVBU R6, -1(R5)
CMP R3, R5
BNE loop1
RETURN