]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: port memmove, memclr to register ABI on s390x
authorSrinivas Pokala <Pokala.Srinivas@ibm.com>
Tue, 11 Nov 2025 04:22:32 +0000 (05:22 +0100)
committerKeith Randall <khr@golang.org>
Mon, 24 Nov 2025 18:22:37 +0000 (10:22 -0800)
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>
src/runtime/memclr_s390x.s
src/runtime/memmove_s390x.s

index 392057565e8cb390d9b5346985604160a47e2039..919423edf78afffcfc4c867fcb92b5a37623e661 100644 (file)
@@ -7,10 +7,14 @@
 // See memclrNoHeapPointers Go doc for important implementation constraints.
 
 // 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    n+8(FP), R5
-
+#else
+       MOVD    R2, R4
+       MOVD    R3, R5
+#endif
        CMPBGE  R5, $32, clearge32
 
 start:
index f4c2b87d9297d48083370e2b9ed770ad89511158..28c6a5dab2073ea1516cf28d10c53c3827c65e34 100644 (file)
@@ -7,10 +7,16 @@
 // See memmove Go doc for important implementation constraints.
 
 // 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    from+8(FP), R4
        MOVD    n+16(FP), R5
+#else
+       MOVD    R4, R5
+       MOVD    R3, R4
+       MOVD    R2, R6
+#endif
 
        CMPBEQ  R6, R4, done