aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/rt0_linux_mips64x.s
diff options
context:
space:
mode:
authorCherry Zhang <lunaria21@gmail.com>2016-04-27 22:18:02 -0400
committerMinux Ma <minux@golang.org>2016-05-01 02:36:46 +0000
commit981395103e9addfc494245979063dc59a327e888 (patch)
treea6bb5586114cd46c7c6e7096ebc2f15a309787ec /src/runtime/rt0_linux_mips64x.s
parent8dc0444a04a8a43887b4ca3753ee63b430cf2602 (diff)
downloadgo-981395103e9addfc494245979063dc59a327e888.tar.gz
go-981395103e9addfc494245979063dc59a327e888.zip
cmd/internal/obj/mips et al.: introduce SB register on mips64x
SB register (R28) is introduced for access external addresses with shorter instruction sequences. It is loaded at entry points. External data within 2G of SB can be accessed this way. cmd/internal/obj: relocaltion R_ADDRMIPS is split into two relocations R_ADDRMIPS and R_ADDRMIPSU, handling the low 16 bits and the "upper" 16 bits of external addresses, respectively, since the instructios may not be adjacent. It might be better if relocation Variant could be used. cmd/link/internal/mips64: support new relocations. cmd/compile/internal/mips64: reserve SB register. runtime: initialize SB register at entry points. Change-Id: I5f34868f88c5a9698c042a8a1f12f76806c187b9 Reviewed-on: https://go-review.googlesource.com/19802 Reviewed-by: Minux Ma <minux@golang.org>
Diffstat (limited to 'src/runtime/rt0_linux_mips64x.s')
-rw-r--r--src/runtime/rt0_linux_mips64x.s5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/rt0_linux_mips64x.s b/src/runtime/rt0_linux_mips64x.s
index c7e35f5e47..6b596677be 100644
--- a/src/runtime/rt0_linux_mips64x.s
+++ b/src/runtime/rt0_linux_mips64x.s
@@ -27,5 +27,10 @@ TEXT _main<>(SB),NOSPLIT,$-8
JMP main(SB)
TEXT main(SB),NOSPLIT,$-8
+ // initalize REGSB = PC&0xffffffff00000000
+ BGEZAL R0, 1(PC)
+ SRLV $32, R31, RSB
+ SLLV $32, RSB
+
MOVV $runtime·rt0_go(SB), R4
JMP (R4)