runtime: port memmove, memclr to register ABI on s390x

This allows memmove and memclr to be invoked using the new
register ABI on s390x.

Update #40724

Change-Id: I2e799aac693ddd693266c156c525d6303060796f
Reviewed-on: https://go-review.googlesource.com/c/go/+/719424
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Vishwanatha HD <vishwanatha.hd@ibm.com>
Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
Srinivas Pokala 2025-11-11 05:22:32 +01:00 committed by Keith Randall
parent 58a48a3e3b
commit 4529c8fba6
2 changed files with 13 additions and 3 deletions

View file

@ -7,10 +7,14 @@
// See memclrNoHeapPointers Go doc for important implementation constraints. // See memclrNoHeapPointers Go doc for important implementation constraints.
// func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr) // func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
TEXT runtime·memclrNoHeapPointers(SB),NOSPLIT|NOFRAME,$0-16 TEXT runtime·memclrNoHeapPointers<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-16
#ifndef GOEXPERIMENT_regabiargs
MOVD ptr+0(FP), R4 MOVD ptr+0(FP), R4
MOVD n+8(FP), R5 MOVD n+8(FP), R5
#else
MOVD R2, R4
MOVD R3, R5
#endif
CMPBGE R5, $32, clearge32 CMPBGE R5, $32, clearge32
start: start:

View file

@ -7,10 +7,16 @@
// See memmove Go doc for important implementation constraints. // See memmove Go doc for important implementation constraints.
// func memmove(to, from unsafe.Pointer, n uintptr) // func memmove(to, from unsafe.Pointer, n uintptr)
TEXT runtime·memmove(SB),NOSPLIT|NOFRAME,$0-24 TEXT runtime·memmove<ABIInternal>(SB),NOSPLIT|NOFRAME,$0-24
#ifndef GOEXPERIMENT_regabiargs
MOVD to+0(FP), R6 MOVD to+0(FP), R6
MOVD from+8(FP), R4 MOVD from+8(FP), R4
MOVD n+16(FP), R5 MOVD n+16(FP), R5
#else
MOVD R4, R5
MOVD R3, R4
MOVD R2, R6
#endif
CMPBEQ R6, R4, done CMPBEQ R6, R4, done