diff options
| author | Evgeny Astigeevich <evgeny.astigeevich@linaro.org> | 2018-06-01 16:53:58 +0100 |
|---|---|---|
| committer | Evgeny Astigeevich <evgeny.astigeevich@linaro.org> | 2018-06-13 21:47:36 +0100 |
| commit | 878f17d7737a91235013ed16ebe057a12367941b (patch) | |
| tree | f18731e59850baf5d0535a1253643884237e889b /compiler/optimizing/code_generator_arm64.h | |
| parent | 32e83b36601e080b01712aeb6e9ebaa512eb0f33 (diff) | |
| download | art-878f17d7737a91235013ed16ebe057a12367941b.tar.gz art-878f17d7737a91235013ed16ebe057a12367941b.tar.bz2 art-878f17d7737a91235013ed16ebe057a12367941b.zip | |
ARM64: Splitting GenerateDivRem* functions into GenerateIntDiv and GenerateIntRem functions
VisitDiv and VisitRem call GenerateDivRemIntegral.
GenerateDivRemIntegral does not know whether it is invoked for HDiv or
HRem and has to check this. As a result all GenerateDivRem* functions
have such checks. Code for optimizing HRem and HDiv, e.g. a denominator is
power of 2, can be specific for HRem or HDiv. So having it in
GenerateDivRem would create issues with code maintenance.
This patch split GenerateDivRem* functions into GenerateIntDiv* and
GenerateIntRem. BTW 'Integral' meaning is not 'Integer'. So changed it
as well. It also removes the case 'division by 1 or -1' because the case
is handled in InstructionSimplifierVisitor. As there is a commonly used
function Int64ConstantFrom(Location) it is used instead of
Int64FromConstant(HConstant). This removes some code as well.
Test: 012-math, 014-math3, 411-optimizing-arith
Test: test-art-host, test-art-target
Change-Id: I972129b24a206c8230d304be551cd2c18dbc7c9c
Diffstat (limited to 'compiler/optimizing/code_generator_arm64.h')
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h index e7fe5b71b7..9c98434a75 100644 --- a/compiler/optimizing/code_generator_arm64.h +++ b/compiler/optimizing/code_generator_arm64.h @@ -326,7 +326,13 @@ class InstructionCodeGeneratorARM64 : public InstructionCodeGenerator { void DivRemOneOrMinusOne(HBinaryOperation* instruction); void DivRemByPowerOfTwo(HBinaryOperation* instruction); void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction); - void GenerateDivRemIntegral(HBinaryOperation* instruction); + void GenerateIntDiv(HDiv* instruction); + void GenerateIntDivForConstDenom(HDiv *instruction); + void GenerateIntDivForPower2Denom(HDiv *instruction); + void GenerateIntRem(HRem* instruction); + void GenerateIntRemForConstDenom(HRem *instruction); + void GenerateIntRemForOneOrMinusOneDenom(HRem *instruction); + void GenerateIntRemForPower2Denom(HRem *instruction); void HandleGoto(HInstruction* got, HBasicBlock* successor); vixl::aarch64::MemOperand VecAddress( |
