]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: refactor cgen_div
authorMichael Munday <munday@ca.ibm.com>
Mon, 11 Apr 2016 01:58:37 +0000 (21:58 -0400)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 11 Apr 2016 05:19:13 +0000 (05:19 +0000)
commit2a4158207edb499f8b210aaa7a9af103b93b5ac7
treeb9b9b04f5910738be15776e78f05f9a371081ab8
parenta00ad5f47ea9c950dd041b33476c2bb4568496e1
cmd/compile/internal/gc: refactor cgen_div

This commit adds two new functions to cgen.go: hasHMUL64 and
hasRROTC64. These are used to determine whether or not an
architecture supports the instructions needed to perform an
optimization in cgen_div.

This commit should not affect existing architectures (although it
does add s390x to the new functions). However, since most
architectures support HMUL the hasHMUL64 function could be
modified to enable most of the optimizations in cgen_div on those
platforms.

Change-Id: I33bf329ddeb6cf2954bd17b7c161012de352fb62
Reviewed-on: https://go-review.googlesource.com/21775
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/cgen.go