]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix load int32 to FP register on big-endian MIPS64
authorCherry Zhang <cherryyz@google.com>
Sat, 27 Aug 2016 23:08:14 +0000 (19:08 -0400)
committerCherry Zhang <cherryyz@google.com>
Sun, 28 Aug 2016 21:38:09 +0000 (21:38 +0000)
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>
src/cmd/compile/internal/mips64/ssa.go

index da30ddc6cff91bbae44ae90312029586b0307b4c..fdeb43fbc80ae166dfe286790828fff9d3220e0b 100644 (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 {