-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
ImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Description
Most functions in the math
package operate on float64s. For users who work with float32s this leads to a lot of code like float32(math.Floor(float64(v))
where var v float32
(where Floor
could be any one of the many math functions). On amd64 with GOAMD64=v2, that example compiles to
CVTSS2SD X0, X1
ROUNDSD $1, X1, X1
CVTSD2SS X1, X1
which is the literal interpretation of the code. I suggest that this sequence gets optimized to a use of ROUNDSS
instead. The example uses ROUNDSD
, but of course I'd like this to work for all relevant instructions.
Metadata
Metadata
Assignees
Labels
ImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Todo