Bug 152186

Summary: B3::reduceStrength should simplify Div(value, 1 << const)
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: ASSIGNED ---    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, msaboff, rmorisset, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=196370
Bug Depends on:    
Bug Blocks: 154319, 196361    
Attachments:
Description Flags
Patch rmorisset: review-, ews-watchlist: commit-queue-

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 EWS Watchlist 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.