mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use soft-float routines for soft-float targets
Updates #18162 (mostly fixes) Change-Id: I35bcb8a688bdaa432adb0ddbb73a2f7adda47b9e Reviewed-on: https://go-review.googlesource.com/37958 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
f0f62fcc46
commit
6be1c09e19
11 changed files with 271 additions and 41 deletions
|
|
@ -1165,6 +1165,21 @@ func calcHasCall(n *Node) bool {
|
|||
// These ops might panic, make sure they are done
|
||||
// before we start marshaling args for a call. See issue 16760.
|
||||
return true
|
||||
|
||||
// When using soft-float, these ops might be rewritten to function calls
|
||||
// so we ensure they are evaluated first.
|
||||
case OADD, OSUB, OMINUS:
|
||||
if thearch.SoftFloat && (isFloat[n.Type.Etype] || isComplex[n.Type.Etype]) {
|
||||
return true
|
||||
}
|
||||
case OLT, OEQ, ONE, OLE, OGE, OGT:
|
||||
if thearch.SoftFloat && (isFloat[n.Left.Type.Etype] || isComplex[n.Left.Type.Etype]) {
|
||||
return true
|
||||
}
|
||||
case OCONV:
|
||||
if thearch.SoftFloat && ((isFloat[n.Type.Etype] || isComplex[n.Type.Etype]) || (isFloat[n.Left.Type.Etype] || isComplex[n.Left.Type.Etype])) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if n.Left != nil && n.Left.HasCall() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue