• Martin Möhrmann's avatar
    cmd/compile: remove superfluous signed right shift used for signed division by 2 · 379d2dea
    Martin Möhrmann authored
    A signed right shift before an unsigned right shift by register width-1
    (extracts the sign bit) is superflous.
    
    trigger counts during ./make.bash
     0   (Rsh8U  (Rsh8  x _) 7  ) -> (Rsh8U  x 7 )
     0   (Rsh16U (Rsh16 x _) 15 ) -> (Rsh16U x 15)
     2   (Rsh32U (Rsh32 x _) 31 ) -> (Rsh32U x 31)
     251 (Rsh64U (Rsh64 x _) 63 ) -> (Rsh64U x 63)
    
    Changes the instructions generated on AMD64 for x / 2 where
    x is a signed integer from:
    
     MOVQ    AX, CX
     SARQ    $63, AX
     SHRQ    $63, AX
     ADDQ    CX, AX
     SARQ    $1, AX
    
    to:
    
     MOVQ    AX, CX
     SHRQ    $63, AX
     ADDQ    CX, AX
     SARQ    $1, AX
    
    Change-Id: I86321ae8fc9dc24b8fa9eb80aa5c7299eff8c9dc
    Reviewed-on: https://go-review.googlesource.com/115956
    Run-TryBot: Martin Möhrmann <moehrmann@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    379d2dea
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...