mirror of
https://github.com/golang/go.git
synced 2025-05-06 08:03:03 +00: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:
parent
8c15a17251
commit
2f679d74e6
@ -103,9 +103,9 @@ func isHILO(r int16) bool {
|
|||||||
// loadByType returns the load instruction of the given type.
|
// loadByType returns the load instruction of the given type.
|
||||||
func loadByType(t ssa.Type, r int16) obj.As {
|
func loadByType(t ssa.Type, r int16) obj.As {
|
||||||
if isFPreg(r) {
|
if isFPreg(r) {
|
||||||
if t.IsFloat() && t.Size() == 4 { // float32
|
if t.Size() == 4 { // float32 or int32
|
||||||
return mips.AMOVF
|
return mips.AMOVF
|
||||||
} else { // float64 or integer in FP register
|
} else { // float64 or int64
|
||||||
return mips.AMOVD
|
return mips.AMOVD
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -138,9 +138,9 @@ func loadByType(t ssa.Type, r int16) obj.As {
|
|||||||
// storeByType returns the store instruction of the given type.
|
// storeByType returns the store instruction of the given type.
|
||||||
func storeByType(t ssa.Type, r int16) obj.As {
|
func storeByType(t ssa.Type, r int16) obj.As {
|
||||||
if isFPreg(r) {
|
if isFPreg(r) {
|
||||||
if t.IsFloat() && t.Size() == 4 { // float32
|
if t.Size() == 4 { // float32 or int32
|
||||||
return mips.AMOVF
|
return mips.AMOVF
|
||||||
} else { // float64 or integer in FP register
|
} else { // float64 or int64
|
||||||
return mips.AMOVD
|
return mips.AMOVD
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user