Reviewers: Benedikt Meurer,

Message:
The CL is actually not as big as it seems, there is a lot of re-shuffling of the
code going on, and platform ports are extremely similar now. :-)

Description:
Consistenly handle power-of-2 divisors in division-like operations

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.


Please review this at https://codereview.chromium.org/175143002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+1444, -940 lines):
  M src/a64/lithium-a64.h
  M src/a64/lithium-a64.cc
  M src/a64/lithium-codegen-a64.cc
  M src/arm/lithium-arm.h
  M src/arm/lithium-arm.cc
  M src/arm/lithium-codegen-arm.cc
  M src/hydrogen-instructions.h
  M src/ia32/lithium-codegen-ia32.cc
  M src/ia32/lithium-ia32.h
  M src/ia32/lithium-ia32.cc
  M src/utils.h
  M src/x64/lithium-codegen-x64.cc
  M src/x64/lithium-x64.h
  M src/x64/lithium-x64.cc


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to