Skip to content

Commit

Permalink
cmd/compile: intrinsify math/big.mulWW on MIPS64(LE),RISCV64
Browse files Browse the repository at this point in the history
Change-Id: Ib8b18a892b0b1a59229ebc97a38200b53e701a77
Reviewed-on: https://go-review.googlesource.com/c/go/+/402574
Reviewed-by: Keith Randall <[email protected]>
Run-TryBot: Wayne Zuo <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
wdvxdr1123 authored and randall77 committed Apr 28, 2022
1 parent 89044b6 commit 4d35071
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/cmd/compile/internal/ssagen/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4675,8 +4675,8 @@ func InitTables() {
return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1])
},
sys.AMD64, sys.ARM64, sys.PPC64, sys.S390X, sys.MIPS64, sys.RISCV64)
alias("math/bits", "Mul", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64, sys.ArchPPC64LE, sys.ArchS390X, sys.ArchMIPS64, sys.ArchMIPS64LE, sys.ArchRISCV64)
alias("runtime/internal/math", "Mul64", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64, sys.ArchPPC64LE, sys.ArchS390X, sys.ArchMIPS64, sys.ArchMIPS64LE, sys.ArchRISCV64)
alias("math/bits", "Mul", "math/bits", "Mul64", p8...)
alias("runtime/internal/math", "Mul64", "math/bits", "Mul64", p8...)
addF("math/bits", "Add64",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
return s.newValue3(ssa.OpAdd64carry, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1], args[2])
Expand Down Expand Up @@ -4749,11 +4749,7 @@ func InitTables() {
alias("sync/atomic", "AddUintptr", "runtime/internal/atomic", "Xadd64", p8...)

/******** math/big ********/
add("math/big", "mulWW",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
return s.newValue2(ssa.OpMul64uhilo, types.NewTuple(types.Types[types.TUINT64], types.Types[types.TUINT64]), args[0], args[1])
},
sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64LE, sys.ArchPPC64, sys.ArchS390X)
alias("math/big", "mulWW", "math/bits", "Mul64", p8...)
}

// findIntrinsic returns a function which builds the SSA equivalent of the
Expand Down

0 comments on commit 4d35071

Please sign in to comment.