OSDN Git Service

Optimize more easy multiplications by constants.
authorElliott Hughes <enh@google.com>
Thu, 25 Feb 2010 00:36:18 +0000 (16:36 -0800)
committerElliott Hughes <enh@google.com>
Thu, 25 Feb 2010 00:36:18 +0000 (16:36 -0800)
commitb4c05977c28c38d2f81b48d0cb15559dc3d05564
treeb40cc2cc302a088b931eb97bdc0fd6997d96f41f
parent88a0f970e47dc0091d2c9965aa9bd06667e5f4b7
Optimize more easy multiplications by constants.

Rather than make these changes in the libraries (*10 being a common case),
let's do them once and for all in the JIT.

The 2^n-1 case could be better if we generated RSB instructions, but the
current "fake" RSB is still better than a full multiply.

Thumb doesn't support reg/reg/reg/shift instructions, so we can't optimize
the "population count <= 2" cases (such as *10) there.

Tested on sholes, passion, and passion-running-sapphire (and visually
inspected to check we weren't trying to generate Thumb2 instructions there).
Also tested with the self-verifier.
vm/Android.mk
vm/compiler/codegen/arm/ArmLIR.h
vm/compiler/codegen/arm/Assemble.c
vm/compiler/codegen/arm/CodegenDriver.c
vm/compiler/codegen/arm/Thumb/Gen.c
vm/compiler/codegen/arm/Thumb2/Gen.c