}
// TestFP tests that both backends have the same result for floating point expressions.
-func TestFP(t *testing.T) {
- if runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" {
- t.Skip("legacy mips64 compiler doesn't handle uint->float conversion correctly (issue 15552)")
- }
- runTest(t, "fp_ssa.go")
-}
+func TestFP(t *testing.T) { runTest(t, "fp_ssa.go") }
// TestArithmeticBoundary tests boundary results for arithmetic operations.
func TestArithmeticBoundary(t *testing.T) { runTest(t, "arithBoundary_ssa.go") }
//return;
// algorithm is:
// if small enough, use native int64 -> float64 conversion.
- // otherwise, halve (rounding to odd?), convert, and double.
+ // otherwise, halve (x -> (x>>1)|(x&1)), convert, and double.
/*
* integer to float
*/
gmove(&bigi, &rtmp)
gins(mips.AAND, &r1, &rtmp)
p1 := ginsbranch(mips.ABEQ, nil, &rtmp, nil, 0)
- p2 := gins(mips.ASRLV, nil, &r1)
+ var r3 gc.Node
+ gc.Regalloc(&r3, gc.Types[gc.TUINT64], nil)
+ p2 := gins3(mips.AAND, nil, &r1, &r3)
p2.From.Type = obj.TYPE_CONST
p2.From.Offset = 1
+ p3 := gins(mips.ASRLV, nil, &r1)
+ p3.From.Type = obj.TYPE_CONST
+ p3.From.Offset = 1
+ gins(mips.AOR, &r3, &r1)
+ gc.Regfree(&r3)
gc.Patch(p1, gc.Pc)
}