mirror of
https://github.com/golang/go
synced 2024-11-23 18:50:05 -07:00
d25c4fbe05
Softfloat mode with register ABI is not implemented yet. In particular, we did not rewrite the float types in AuxCalls to integer types, so arguments are still passed in floating point registers, which do not exist in softfloat mode. To make it work I think we may want to reorder softfloat pass with expand_calls pass. We also need to rewrite the OpArgFloatRegs for the spilling of non-SSA-able arguments, which may involve renumbering interger arguments. Maybe in softfloat mode we want to just define the ABI with 0 float registers. They are not fundamentally hard, but may be not worth doing for the moment, as we don't use softfloat mode on AMD64 anyway. Run the test with noregabiargs. Also in the compiler reject -d=softfloat if regabiargs is enabled. Change-Id: I8cc0c2cfa88a138bc1338ed8710670245f1bd2cd Reviewed-on: https://go-review.googlesource.com/c/go/+/308710 Trust: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
32 lines
649 B
Go
32 lines
649 B
Go
// run -gcflags=-d=softfloat -goexperiment noregabiargs
|
|
|
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// When using soft-float, OMUL might be rewritten to function
|
|
// call so we should ensure it was evaluated first. Stack frame
|
|
// setup for "test" function call should happen after call to runtime.fmul32
|
|
|
|
var x int32 = 1
|
|
|
|
func main() {
|
|
var y float32 = 1.0
|
|
test(x, y*y)
|
|
}
|
|
|
|
//go:noinline
|
|
func test(id int32, a float32) {
|
|
|
|
if id != x {
|
|
fmt.Printf("got: %d, want: %d\n", id, x)
|
|
panic("FAIL")
|
|
}
|
|
}
|