Commit 2f679d74 authored by Cherry Zhang's avatar Cherry Zhang

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: default avatarMinux Ma <minux@golang.org>
parent 8c15a172
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment