1
0
mirror of https://github.com/golang/go synced 2024-11-18 00:04:43 -07:00

cmd/compile: fix load int32 to FP register on big-endian MIPS64

Fixes #16903.

Change-Id: I1f6fcd57e14b2b62e208b7bb3adccd5fd7f8bdbc
Reviewed-on: https://go-review.googlesource.com/27933
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Cherry Zhang 2016-08-27 19:08:14 -04:00
parent 8c15a17251
commit 2f679d74e6

View File

@ -103,9 +103,9 @@ func isHILO(r int16) bool {
// loadByType returns the load instruction of the given type.
func loadByType(t ssa.Type, r int16) obj.As {
if isFPreg(r) {
if t.IsFloat() && t.Size() == 4 { // float32
if t.Size() == 4 { // float32 or int32
return mips.AMOVF
} else { // float64 or integer in FP register
} else { // float64 or int64
return mips.AMOVD
}
} else {
@ -138,9 +138,9 @@ func loadByType(t ssa.Type, r int16) obj.As {
// storeByType returns the store instruction of the given type.
func storeByType(t ssa.Type, r int16) obj.As {
if isFPreg(r) {
if t.IsFloat() && t.Size() == 4 { // float32
if t.Size() == 4 { // float32 or int32
return mips.AMOVF
} else { // float64 or integer in FP register
} else { // float64 or int64
return mips.AMOVD
}
} else {