Hello,

A few details to help the reviewers.

- The hydrogen level optimization to optimize HBitwise instructions away
when canonicalizing has been moved down to Lithium level.
  Removing the HBitwise instruction loses information on how the inputs are
used and prevents from recognizing patterns like (expr | 0) when inserting
representation changes (see below).
  The problem with moving this down to Lithium is that the code is
duplicated for all architectures.
- The first step, triggered during the range inference, visits the Hydrogen
graph to mark operations only used by bitwise operations. This allows to
discard for example overflow checks or bailout on minus zero.
  We may want to move this somewhere else.
- The second steps occurs when representation changes are inserted before a
bitwise operation. We try to recognize patterns like ((a / b) | 0) or
Math.floor(a / b) and optimize the generated code.
- Basic support has been added for other architectures than ARM, but they
still lack the optimized code part (implementation should be easy on ia32
and x64).

The optimization can be extended to support more cases. I think this
handles enough for a first step.

Please don't hesitate to ask me for details (email or chat).

Alexandre

On Tue, Jan 31, 2012 at 3:26 PM, <[email protected]> wrote:

> Reviewers: danno,
>
> Description:
> Optimise code for bitwise usage
>
> BUG=none
> TEST=Added bitwise-use.js, math-floor-div.js
>
> Please review this at 
> http://codereview.chromium.**org/9301041/<http://codereview.chromium.org/9301041/>
>
> SVN Base: 
> http://v8.googlecode.com/svn/**branches/bleeding_edge/<http://v8.googlecode.com/svn/branches/bleeding_edge/>
>
> Affected files:
>  M     src/arm/lithium-arm.h
>  M     src/arm/lithium-arm.cc
>  M     src/arm/lithium-codegen-arm.h
>  M     src/arm/lithium-codegen-arm.cc
>  M     src/arm/macro-assembler-arm.h
>  M     src/arm/macro-assembler-arm.cc
>  M     src/hydrogen-instructions.h
>  M     src/hydrogen-instructions.cc
>  M     src/hydrogen.cc
>  M     src/ia32/lithium-codegen-ia32.**cc
>  M     src/ia32/lithium-ia32.h
>  M     src/ia32/lithium-ia32.cc
>  M     src/mips/lithium-codegen-mips.**cc
>  M     src/mips/lithium-mips.h
>  M     src/mips/lithium-mips.cc
>  M     src/utils.h
>  M     src/utils.cc
>  M     src/x64/lithium-codegen-x64.cc
>
>
> --
> v8-dev mailing list
> [email protected]
> http://groups.google.com/**group/v8-dev<http://groups.google.com/group/v8-dev>

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to