Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Issue 189433008: MIPS: Consistenly handle power-of-2 divisors in division-like operations. (Closed)

Created:
6 years, 9 months ago by kilvadyb
Modified:
6 years, 9 months ago
CC:
v8-dev
Base URL:
https://github.com/v8/v8.git@gbl
Visibility:
Public.

Description

MIPS: Consistenly handle power-of-2 divisors in division-like operations. Port r19715 (0d6d244) Original commit message: Lithium currently supports 3 division-like operations on integral operands: "Normal" division (rounding towards zero), flooring division (rounding towards -Infinity) and modulus calculation (the counterpart for the "normal" division). For divisors which are a power of 2, one can efficiently use some bit fiddling to avoid the actual division for such operations. This CL cleanly splits off these operations into separate Lithium instructions, making the code much more maintainable and more consistent across platforms. There are 2 basic variations of these bit fiddling algorithms: One involving branches and a seemingly more clever one without branches. Choosing between the two is not as easy as it seems: Benchmarks (and probably real-world) programs seem to favor positive dividends, registers and shifting units are sometimes scarce resources, and branch prediction is quite good in modern processors. Therefore only the "normal" division by a power of 2 is implemented in a branch-free manner, this seems to be the best approach in practice. If this turns out to be wrong, we can easily and locally change this. BUG=

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -161 lines) Patch
M src/mips/lithium-codegen-mips.cc View 2 chunks +114 lines, -100 lines 0 comments Download
M src/mips/lithium-mips.h View 5 chunks +42 lines, -21 lines 0 comments Download
M src/mips/lithium-mips.cc View 3 chunks +66 lines, -40 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
kilvadyb
6 years, 9 months ago (2014-03-07 20:32:26 UTC) #1
Paul Lind
LGTM. Note to Sven and rest of Google team, this gets us building/testing ok, but ...
6 years, 9 months ago (2014-03-07 22:09:53 UTC) #2
Paul Lind
6 years, 9 months ago (2014-03-07 22:15:30 UTC) #3
Committed as r19733.

Powered by Google App Engine
This is Rietveld 408576698