]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/mips: use LR as temporary register in RET
authorCherry Zhang <cherryyz@google.com>
Tue, 21 Nov 2017 14:25:29 +0000 (09:25 -0500)
committerCherry Zhang <cherryyz@google.com>
Tue, 13 Feb 2018 15:59:55 +0000 (15:59 +0000)
commit1e0ef6601da8ee0a14def5c82eb298fcdab97cf6
treee0edcf16d87bebc2f0bd70139279471751210f8e
parent36951a9f638b03950b7413eee73bd0e3ccf47130
cmd/internal/obj/mips: use LR as temporary register in RET

On mips/mips64, for non-leaf function, RET is assembled as
MOV (SP), R4       // load saved LR
ADD $framesize, SP
JMP (R4)

This clobbers R4 unnecessarily. Use the link register as
temporary instead.

Probably for Go 1.11.

Change-Id: I2209db7be11074ed2e0e0829cace95ebfb709e9f
Reviewed-on: https://go-review.googlesource.com/79016
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/internal/obj/mips/obj0.go