]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/internal/syscall: convert PPC64 Syscall6 to ABIInternal
authorPaul E. Murphy <murp@ibm.com>
Tue, 18 Oct 2022 15:22:17 +0000 (10:22 -0500)
committerPaul Murphy <murp@ibm.com>
Tue, 25 Oct 2022 15:23:37 +0000 (15:23 +0000)
This avoids a lot of stacking.

Change-Id: If5c5cf33335ffdcb7eecbd3f2db7858a415d817d
Reviewed-on: https://go-review.googlesource.com/c/go/+/443736
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
src/runtime/internal/syscall/asm_linux_ppc64x.s

index 8cf8737df884e1ee51bffda4210ebbd0afd82719..3e985edea05c8830b65f467e563dc1b0a4b77c99 100644 (file)
@@ -7,22 +7,17 @@
 #include "textflag.h"
 
 // func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
-TEXT ·Syscall6(SB),NOSPLIT,$0-80
-       MOVD    num+0(FP), R9   // syscall entry
-       MOVD    a1+8(FP), R3
-       MOVD    a2+16(FP), R4
-       MOVD    a3+24(FP), R5
-       MOVD    a4+32(FP), R6
-       MOVD    a5+40(FP), R7
-       MOVD    a6+48(FP), R8
-       SYSCALL R9
-       MOVD    R0, r2+64(FP) // r2 is not used. Always set to 0.
-       BVC     ok
-       MOVD    $-1, R4
-       MOVD    R4, r1+56(FP)
-       MOVD    R3, errno+72(FP)
-       RET
-ok:
-       MOVD    R3, r1+56(FP)
-       MOVD    R0, errno+72(FP)
+TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0-80
+       MOVD    R3, R10 // Move syscall number to R10. SYSCALL will move it R0, and restore R0.
+       MOVD    R4, R3
+       MOVD    R5, R4
+       MOVD    R6, R5
+       MOVD    R7, R6
+       MOVD    R8, R7
+       MOVD    R9, R8
+       SYSCALL R10
+       MOVD    $-1, R6
+       ISEL    CR0SO, R3, R0, R5 // errno = (error) ? R3 : 0
+       ISEL    CR0SO, R6, R3, R3 // r1 = (error) ? -1 : 0
+       MOVD    $0, R4            // r2 is not used on linux/ppc64
        RET