Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: TestFP fail on linux/mips64 #16903

Closed
minux opened this issue Aug 27, 2016 · 5 comments
Closed

cmd/compile: TestFP fail on linux/mips64 #16903

minux opened this issue Aug 27, 2016 · 5 comments
Milestone

Comments

@minux
Copy link
Member

minux commented Aug 27, 2016

See https://build.golang.org/log/c6251926ba6ec8827b6b486ba21a4e32ab932f2d

--- FAIL: TestFP (16.39s)
    ssa_test.go:32: Failed: exit status 1:
        Out: Saw 4 failures

        Stderr: F64 Expected +2.147484e+009 for e , got -1.000000e+000
        F64 Expected -2.147484e+009 for e , got -2.000000e+000
        F32 Expected +2.147484e+009 for e , got -1.000000e+000
        F32 Expected -2.147484e+009 for e , got -2.000000e+000
        panic: Failed.

        goroutine 1 [running]:
        panic(0xbcd60, 0xc42000a440)
            /gobuild/gobuilder/linux-mips64-minux-3427f16642a1/go/src/runtime/panic.go:500 +0x194
        main.main()
            /gobuild/gobuilder/linux-mips64-minux-3427f16642a1/go/src/cmd/compile/internal/gc/testdata/fp_ssa.go:1700 +0x1324
        exit status 2

FAIL
FAIL    cmd/compile/internal/gc 832.801s

/cc @cherrymui

@minux minux added this to the Go1.8 milestone Aug 27, 2016
@cherrymui
Copy link
Member

Coudl you try if this patch fix the problem? I am having problem to push to gerrit now.

diff --git a/src/cmd/compile/internal/mips64/ssa.go b/src/cmd/compile/internal/mips64/ssa.go
index da30ddc..fdeb43f 100644
--- a/src/cmd/compile/internal/mips64/ssa.go
+++ b/src/cmd/compile/internal/mips64/ssa.go
@@ -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 {

@cherrymui cherrymui self-assigned this Aug 27, 2016
@minux
Copy link
Member Author

minux commented Aug 28, 2016 via email

@minux
Copy link
Member Author

minux commented Aug 28, 2016 via email

@cherrymui
Copy link
Member

Thank you. CL https://go-review.googlesource.com/c/27933/ sent.

@gopherbot
Copy link

CL https://golang.org/cl/27933 mentions this issue.

@golang golang locked and limited conversation to collaborators Aug 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants