Bug 152186 - B3::reduceStrength should simplify Div(value, 1 << const)
Summary: B3::reduceStrength should simplify Div(value, 1 << const)
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords:
Depends on:
Blocks: 154319 196361
  Show dependency treegraph
 
Reported: 2015-12-11 13:34 PST by Filip Pizlo
Modified: 2019-03-29 16:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (12.00 KB, patch)
2019-03-28 14:47 PDT, Robin Morisset
rmorisset: review-
ews: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-12-11 13:34:17 PST
asm.js needs this.
Comment 1 Robin Morisset 2019-03-28 14:47:05 PDT
Created attachment 366211 [details]
Patch
Comment 2 Build Bot 2019-03-28 17:28:54 PDT
Comment on attachment 366211 [details]
Patch

Attachment 366211 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/11695667

New failing tests:
microbenchmarks/integer-modulo.js.ftl-eager
jsc-layout-tests.yaml/js/script-tests/integer-division-neg2tothe32-by-neg1.js.layout-ftl-eager-no-cjit
microbenchmarks/integer-modulo.js.ftl-eager-no-cjit
microbenchmarks/integer-modulo.js.ftl-no-cjit-no-inline-validate
microbenchmarks/integer-modulo.js.ftl-no-cjit-no-put-stack-validate
stress/op_mod-VarConst.js.misc-ftl-no-cjit
microbenchmarks/integer-modulo.js.ftl-no-cjit-validate-sampling-profiler
Comment 3 Robin Morisset 2019-03-29 16:07:48 PDT
I think I found the bug: I assumed that Div was rounding towards -Infinity, but it appears to round towards 0 (or x % y would not be equal to x - (x / y ) * y).
I am not entirely sure how to fix it right now.