• Lynn Boger's avatar
    cmd/compile: add rotates to PPC64.rules · 9248ff46
    Lynn Boger authored
    This updates PPC64.rules to include rules to generate rotates
    for ADD, OR, XOR operators that combine two opposite shifts
    that sum to 32 or 64.
    
    To support this change opcodes for ROTL and ROTLW were added to
    be used like the rotldi and rotlwi extended mnemonics.
    
    This provides the following improvement in sha3:
    
    BenchmarkPermutationFunction-8     302.83       376.40       1.24x
    BenchmarkSha3_512_MTU-8            98.64        121.92       1.24x
    BenchmarkSha3_384_MTU-8            136.80       168.30       1.23x
    BenchmarkSha3_256_MTU-8            169.21       211.29       1.25x
    BenchmarkSha3_224_MTU-8            179.76       221.19       1.23x
    BenchmarkShake128_MTU-8            212.87       263.23       1.24x
    BenchmarkShake256_MTU-8            196.62       245.60       1.25x
    BenchmarkShake256_16x-8            163.57       194.37       1.19x
    BenchmarkShake256_1MiB-8           199.02       248.74       1.25x
    BenchmarkSha3_512_1MiB-8           106.55       133.13       1.25x
    
    Fixes #20030
    
    Change-Id: I484c56f48395d32f53ff3ecb3ac6cb8191cfee44
    Reviewed-on: https://go-review.googlesource.com/40992
    Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
    Reviewed-by: default avatarMichael Munday <munday@ca.ibm.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    9248ff46
ssa.go 31.6 KB