1
0
mirror of https://github.com/golang/go synced 2024-11-23 09:50:03 -07:00

runtime: remove new g register (X27) from preempt save/restore

The g register is now in X27 (previously X4, which collided with TP usage). Remove
X27 from preempt save/restore.

Change-Id: I9dd38ec3a8222fa0710757463769dbfac8ae7d20
Reviewed-on: https://go-review.googlesource.com/c/go/+/265517
Trust: Joel Sing <joel@sing.id.au>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Joel Sing 2020-10-27 23:10:13 +11:00
parent fc116b69e2
commit 76661d12e8
2 changed files with 77 additions and 79 deletions

View File

@ -495,12 +495,12 @@ func genPPC64() {
}
func genRISCV64() {
// X0 (zero), X1 (LR), X2 (SP), X4 (g), X31 (TMP) are special.
// X0 (zero), X1 (LR), X2 (SP), X4 (TP), X27 (g), X31 (TMP) are special.
var l = layout{sp: "X2", stack: 8}
// Add integer registers (X3, X5-X30).
// Add integer registers (X3, X5-X26, X28-30).
for i := 3; i < 31; i++ {
if i == 4 {
if i == 4 || i == 27 {
continue
}
reg := fmt.Sprintf("X%d", i)

View File

@ -4,8 +4,8 @@
#include "textflag.h"
TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
MOV X1, -480(X2)
ADD $-480, X2
MOV X1, -472(X2)
ADD $-472, X2
MOV X3, 8(X2)
MOV X5, 16(X2)
MOV X6, 24(X2)
@ -29,79 +29,77 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
MOV X24, 168(X2)
MOV X25, 176(X2)
MOV X26, 184(X2)
MOV X27, 192(X2)
MOV X28, 200(X2)
MOV X29, 208(X2)
MOV X30, 216(X2)
MOVD F0, 224(X2)
MOVD F1, 232(X2)
MOVD F2, 240(X2)
MOVD F3, 248(X2)
MOVD F4, 256(X2)
MOVD F5, 264(X2)
MOVD F6, 272(X2)
MOVD F7, 280(X2)
MOVD F8, 288(X2)
MOVD F9, 296(X2)
MOVD F10, 304(X2)
MOVD F11, 312(X2)
MOVD F12, 320(X2)
MOVD F13, 328(X2)
MOVD F14, 336(X2)
MOVD F15, 344(X2)
MOVD F16, 352(X2)
MOVD F17, 360(X2)
MOVD F18, 368(X2)
MOVD F19, 376(X2)
MOVD F20, 384(X2)
MOVD F21, 392(X2)
MOVD F22, 400(X2)
MOVD F23, 408(X2)
MOVD F24, 416(X2)
MOVD F25, 424(X2)
MOVD F26, 432(X2)
MOVD F27, 440(X2)
MOVD F28, 448(X2)
MOVD F29, 456(X2)
MOVD F30, 464(X2)
MOVD F31, 472(X2)
MOV X28, 192(X2)
MOV X29, 200(X2)
MOV X30, 208(X2)
MOVD F0, 216(X2)
MOVD F1, 224(X2)
MOVD F2, 232(X2)
MOVD F3, 240(X2)
MOVD F4, 248(X2)
MOVD F5, 256(X2)
MOVD F6, 264(X2)
MOVD F7, 272(X2)
MOVD F8, 280(X2)
MOVD F9, 288(X2)
MOVD F10, 296(X2)
MOVD F11, 304(X2)
MOVD F12, 312(X2)
MOVD F13, 320(X2)
MOVD F14, 328(X2)
MOVD F15, 336(X2)
MOVD F16, 344(X2)
MOVD F17, 352(X2)
MOVD F18, 360(X2)
MOVD F19, 368(X2)
MOVD F20, 376(X2)
MOVD F21, 384(X2)
MOVD F22, 392(X2)
MOVD F23, 400(X2)
MOVD F24, 408(X2)
MOVD F25, 416(X2)
MOVD F26, 424(X2)
MOVD F27, 432(X2)
MOVD F28, 440(X2)
MOVD F29, 448(X2)
MOVD F30, 456(X2)
MOVD F31, 464(X2)
CALL ·asyncPreempt2(SB)
MOVD 472(X2), F31
MOVD 464(X2), F30
MOVD 456(X2), F29
MOVD 448(X2), F28
MOVD 440(X2), F27
MOVD 432(X2), F26
MOVD 424(X2), F25
MOVD 416(X2), F24
MOVD 408(X2), F23
MOVD 400(X2), F22
MOVD 392(X2), F21
MOVD 384(X2), F20
MOVD 376(X2), F19
MOVD 368(X2), F18
MOVD 360(X2), F17
MOVD 352(X2), F16
MOVD 344(X2), F15
MOVD 336(X2), F14
MOVD 328(X2), F13
MOVD 320(X2), F12
MOVD 312(X2), F11
MOVD 304(X2), F10
MOVD 296(X2), F9
MOVD 288(X2), F8
MOVD 280(X2), F7
MOVD 272(X2), F6
MOVD 264(X2), F5
MOVD 256(X2), F4
MOVD 248(X2), F3
MOVD 240(X2), F2
MOVD 232(X2), F1
MOVD 224(X2), F0
MOV 216(X2), X30
MOV 208(X2), X29
MOV 200(X2), X28
MOV 192(X2), X27
MOVD 464(X2), F31
MOVD 456(X2), F30
MOVD 448(X2), F29
MOVD 440(X2), F28
MOVD 432(X2), F27
MOVD 424(X2), F26
MOVD 416(X2), F25
MOVD 408(X2), F24
MOVD 400(X2), F23
MOVD 392(X2), F22
MOVD 384(X2), F21
MOVD 376(X2), F20
MOVD 368(X2), F19
MOVD 360(X2), F18
MOVD 352(X2), F17
MOVD 344(X2), F16
MOVD 336(X2), F15
MOVD 328(X2), F14
MOVD 320(X2), F13
MOVD 312(X2), F12
MOVD 304(X2), F11
MOVD 296(X2), F10
MOVD 288(X2), F9
MOVD 280(X2), F8
MOVD 272(X2), F7
MOVD 264(X2), F6
MOVD 256(X2), F5
MOVD 248(X2), F4
MOVD 240(X2), F3
MOVD 232(X2), F2
MOVD 224(X2), F1
MOVD 216(X2), F0
MOV 208(X2), X30
MOV 200(X2), X29
MOV 192(X2), X28
MOV 184(X2), X26
MOV 176(X2), X25
MOV 168(X2), X24
@ -125,7 +123,7 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
MOV 24(X2), X6
MOV 16(X2), X5
MOV 8(X2), X3
MOV 480(X2), X1
MOV 472(X2), X1
MOV (X2), X31
ADD $488, X2
ADD $480, X2
JMP (X31)