summaryrefslogtreecommitdiffstats
path: root/compiler/dex/quick/mips
diff options
context:
space:
mode:
authorNingsheng Jian <ningsheng.jian@arm.com>2014-10-23 13:48:36 +0800
committerIan Rogers <irogers@google.com>2014-11-05 11:37:37 -0800
commit675e09b2753c2fcd521bd8f0230a0abf06e9b0e9 (patch)
tree9a5f41cb1dd1930ae003feeccb4211d59b465e19 /compiler/dex/quick/mips
parent211d45e059935a7874a1ec89846f03d35ffba29f (diff)
downloadart-675e09b2753c2fcd521bd8f0230a0abf06e9b0e9.tar.gz
art-675e09b2753c2fcd521bd8f0230a0abf06e9b0e9.tar.bz2
art-675e09b2753c2fcd521bd8f0230a0abf06e9b0e9.zip
ARM: Strength reduction for floating-point division
For floating-point division by power of two constants, generate multiplication by the reciprocal instead. Change-Id: I39c79eeb26b60cc754ad42045362b79498c755be
Diffstat (limited to 'compiler/dex/quick/mips')
-rw-r--r--compiler/dex/quick/mips/codegen_mips.h4
-rw-r--r--compiler/dex/quick/mips/fp_mips.cc14
2 files changed, 18 insertions, 0 deletions
diff --git a/compiler/dex/quick/mips/codegen_mips.h b/compiler/dex/quick/mips/codegen_mips.h
index dc6930c45b..7e9d80df65 100644
--- a/compiler/dex/quick/mips/codegen_mips.h
+++ b/compiler/dex/quick/mips/codegen_mips.h
@@ -31,6 +31,10 @@ class MipsMir2Lir FINAL : public Mir2Lir {
bool SmallLiteralDivRem(Instruction::Code dalvik_opcode, bool is_div, RegLocation rl_src,
RegLocation rl_dest, int lit);
bool EasyMultiply(RegLocation rl_src, RegLocation rl_dest, int lit) OVERRIDE;
+ void GenMultiplyByConstantFloat(RegLocation rl_dest, RegLocation rl_src1,
+ int32_t constant) OVERRIDE;
+ void GenMultiplyByConstantDouble(RegLocation rl_dest, RegLocation rl_src1,
+ int64_t constant) OVERRIDE;
LIR* CheckSuspendUsingLoad() OVERRIDE;
RegStorage LoadHelper(QuickEntrypointEnum trampoline) OVERRIDE;
LIR* LoadBaseDisp(RegStorage r_base, int displacement, RegStorage r_dest,
diff --git a/compiler/dex/quick/mips/fp_mips.cc b/compiler/dex/quick/mips/fp_mips.cc
index 431591512e..0a7aa99c98 100644
--- a/compiler/dex/quick/mips/fp_mips.cc
+++ b/compiler/dex/quick/mips/fp_mips.cc
@@ -113,6 +113,20 @@ void MipsMir2Lir::GenArithOpDouble(Instruction::Code opcode,
StoreValueWide(rl_dest, rl_result);
}
+void MipsMir2Lir::GenMultiplyByConstantFloat(RegLocation rl_dest, RegLocation rl_src1,
+ int32_t constant) {
+ // TODO: need mips implementation.
+ UNUSED(rl_dest, rl_src1, constant);
+ LOG(FATAL) << "Unimplemented GenMultiplyByConstantFloat in mips";
+}
+
+void MipsMir2Lir::GenMultiplyByConstantDouble(RegLocation rl_dest, RegLocation rl_src1,
+ int64_t constant) {
+ // TODO: need mips implementation.
+ UNUSED(rl_dest, rl_src1, constant);
+ LOG(FATAL) << "Unimplemented GenMultiplyByConstantDouble in mips";
+}
+
void MipsMir2Lir::GenConversion(Instruction::Code opcode, RegLocation rl_dest,
RegLocation rl_src) {
int op = kMipsNop;