• Michael Munday's avatar
    cmd/compile/internal/gc: refactor cgen_div · 2a415820
    Michael Munday authored
    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/21775Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
    Run-TryBot: Matthew Dempsky <mdempsky@google.com>
    Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    2a415820
cgen.go 80 KB