mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: rewrite some AMD64 rules to use typed aux fields
Surprisingly many rules needed no modification. Use wrapper functions for aux like we did for auxint. Simplifies things a bit. Change-Id: I2e852e77f1585dcb306a976ab9335f1ac5b4a770 Reviewed-on: https://go-review.googlesource.com/c/go/+/227961 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Munday <mike.munday@ibm.com>
This commit is contained in:
parent
7580937524
commit
2f84caebe3
5 changed files with 336 additions and 519 deletions
|
|
@ -593,10 +593,26 @@ func float32ToAuxInt(f float32) int64 {
|
|||
func float64ToAuxInt(f float64) int64 {
|
||||
return int64(math.Float64bits(f))
|
||||
}
|
||||
func ValAndOffToAuxInt(v ValAndOff) int64 {
|
||||
func valAndOffToAuxInt(v ValAndOff) int64 {
|
||||
return int64(v)
|
||||
}
|
||||
|
||||
func auxToString(i interface{}) string {
|
||||
return i.(string)
|
||||
}
|
||||
func auxToSym(i interface{}) Sym {
|
||||
// TODO: kind of a hack - allows nil interface through
|
||||
s, _ := i.(Sym)
|
||||
return s
|
||||
}
|
||||
|
||||
func stringToAux(s string) interface{} {
|
||||
return s
|
||||
}
|
||||
func symToAux(s Sym) interface{} {
|
||||
return s
|
||||
}
|
||||
|
||||
// uaddOvf reports whether unsigned a+b would overflow.
|
||||
func uaddOvf(a, b int64) bool {
|
||||
return uint64(a)+uint64(b) < uint64(a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue