• fedor's avatar
    binary-operator-reducer: reduce mul+div(shift) · 461e5b49
    fedor authored
    Reduction Input:
    
        ChangeInt32ToFloat64=>          TruncateFloat64ToInt32
                             Float64Mul=>
        ChangeInt32ToFloat64=>          Float64Div=>TruncateFloat64ToInt32
    
    Output:
    
             =>  TruncateInt64ToInt32
    Int64Mul
             =>  Int64Shr => TruncateInt64ToInt32
    
    Test code:
    
        function mul(a, b) {
          var l = a & 0x3ffffff;
          var h = b & 0x3ffffff;
          var m = l * h;
    
          var rl = m & 0x3ffffff;
          var rh = (m / 0x4000000) | 0;
    
          return rl | rh;
        }
    
        mul(1, 2);
        var a0 = mul(0x3ffffff, 0x3ffffff);
        mul(0x0, 0x0);
        %OptimizeFunctionOnNextCall(mul);
        var a1 = mul(0x3ffffff, 0x3ffffff);
    
        print(a0 + ' == ' + a1);
    
    BUG=
    R=mstarzinger@chromium.org
    
    Review URL: https://codereview.chromium.org/1350223006
    
    Cr-Commit-Position: refs/heads/master@{#31899}
    461e5b49
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
docs Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party/binutils Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...