Home | History | Annotate | Download | only in runtime
      1 // Copyright 2014 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 // void runtimememmove(void*, void*, uintptr)
      8 TEXT runtimememmove(SB), NOSPLIT, $-8-24
      9 	MOVD	to+0(FP), R3
     10 	MOVD	from+8(FP), R4
     11 	MOVD	n+16(FP), R5
     12 	CMP	$0, R5
     13 	BNE	check
     14 	RET
     15 
     16 check:
     17 	CMP	R3, R4
     18 	BLT	backward
     19 
     20 	ADD	R3, R5
     21 loop:
     22 	MOVBU.P	1(R4), R6
     23 	MOVBU.P	R6, 1(R3)
     24 	CMP	R3, R5
     25 	BNE	loop
     26 	RET
     27 
     28 backward:
     29 	ADD	R5, R4
     30 	ADD	R3, R5
     31 loop1:
     32 	MOVBU.W	-1(R4), R6
     33 	MOVBU.W	R6, -1(R5)
     34 	CMP	R3, R5
     35 	BNE	loop1
     36 	RET
     37