]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use FP offsets for pipe/pipe2 on freebsd/arm64 and linux/arm64
authorJoel Sing <joel@sing.id.au>
Tue, 7 Jan 2020 06:14:51 +0000 (17:14 +1100)
committerJoel Sing <joel@sing.id.au>
Wed, 8 Jan 2020 14:58:33 +0000 (14:58 +0000)
This is more readable and less error-prone than using RSP offsets.

Suggested during review of CL 212765.

Change-Id: I070190abeeac8eae5dbd414407602619d9d57422
Reviewed-on: https://go-review.googlesource.com/c/go/+/213577
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/sys_freebsd_arm64.s
src/runtime/sys_linux_arm64.s

index 78cd9f15ee38338821caa1a96d93fe0755496006..2330f2ffe2cb66496531845d7fe9482becf1b58e 100644 (file)
@@ -129,7 +129,7 @@ ok:
 
 // func pipe() (r, w int32, errno int32)
 TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       ADD     $8, RSP, R0
+       MOVD    $r+0(FP), R0
        MOVW    $0, R1
        MOVD    $SYS_pipe2, R8
        SVC
@@ -141,7 +141,7 @@ ok:
 
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
-       ADD     $16, RSP, R0
+       MOVD    $r+8(FP), R0
        MOVW    flags+0(FP), R1
        MOVD    $SYS_pipe2, R8
        SVC
index 8c2a249c9fed2c52350d2032cb6657037cb25dc4..b9588cec301fc2636eeb8fda30cd06422646c619 100644 (file)
@@ -112,7 +112,7 @@ TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
 
 // func pipe() (r, w int32, errno int32)
 TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
-       ADD     $8, RSP, R0
+       MOVD    $r+0(FP), R0
        MOVW    $0, R1
        MOVW    $SYS_pipe2, R8
        SVC
@@ -121,7 +121,7 @@ TEXT runtime·pipe(SB),NOSPLIT|NOFRAME,$0-12
 
 // func pipe2(flags int32) (r, w int32, errno int32)
 TEXT runtime·pipe2(SB),NOSPLIT|NOFRAME,$0-20
-       ADD     $16, RSP, R0
+       MOVD    $r+8(FP), R0
        MOVW    flags+0(FP), R1
        MOVW    $SYS_pipe2, R8
        SVC