Skip to content

Commit 7a63403

Browse files
committed
cmd/compile: fix Mul->Mul64 intrinsic alias
The alias declaration needs to come after the function it is aliasing. It isn't a big deal in this case, as bits.Mul inlines and has as its body bits.Mul64, so the desired code gets generated regardless. The alias should only have an effect on inlining cost estimates (for functions that call bits.Mul). Change-Id: I0d814899ce7049a0fb36e8ce1ad5ababbaf6265f Reviewed-on: https://go-review.googlesource.com/c/144597 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Giovanni Bajo <[email protected]>
1 parent 9627180 commit 7a63403

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/gc/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3474,12 +3474,12 @@ func init() {
34743474
addF("math/bits", "OnesCount",
34753475
makeOnesCountAMD64(ssa.OpPopCount64, ssa.OpPopCount32),
34763476
sys.AMD64)
3477-
alias("math/bits", "Mul", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64)
34783477
addF("math/bits", "Mul64",
34793478
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
34803479
return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1])
34813480
},
34823481
sys.AMD64, sys.ARM64, sys.PPC64)
3482+
alias("math/bits", "Mul", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64)
34833483

34843484
addF("math/bits", "Add64",
34853485
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {

0 commit comments

Comments
 (0)