]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify div/mod on ARM
authorCherry Zhang <cherryyz@google.com>
Mon, 19 Sep 2016 11:45:08 +0000 (07:45 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 20 Sep 2016 13:40:48 +0000 (13:40 +0000)
commit38cd79889ece342643b56ad6d496ef8931ca9272
tree798540d48b188adac947c3709d6a2a6f8b4d80c6
parentf964810025ae58b623798a1944c39c06266fb45d
cmd/compile: simplify div/mod on ARM

On ARM, DIV, DIVU, MOD, MODU are pseudo instructions that makes
runtime calls _div/_udiv/_mod/_umod, which themselves are wrappers
of udiv. The udiv function does the real thing.

Instead of generating these pseudo instructions, call to udiv
directly. This removes one layer of wrappers (which has an awkward
way of passing argument), and also allows combining DIV and MOD
if both results are needed.

Change-Id: I118afc3986db3a1daabb5c1e6e57430888c91817
Reviewed-on: https://go-review.googlesource.com/29390
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/arm/ssa.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/gen/ARM.rules
src/cmd/compile/internal/ssa/gen/ARMOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteARM.go
src/runtime/vlop_arm.s