summaryrefslogtreecommitdiff
path: root/src/compiler/codegen
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-11-27 16:09:55 -0800
committer buzbee <buzbee@google.com> 2012-11-27 16:12:37 -0800
commita3a82b219531effb53aef13f48e50db9bf0f9fb5 (patch)
tree841056cc525f4b8547f914ab39bc17e2cea47c39 /src/compiler/codegen
parent9c85bc0b6577ee00e4e2d3ee9a7d0fd72d7a4966 (diff)
Quick compiler: minor cleanup
Remove dead software floating point support. Move a common function from target specific to target independent. Change-Id: Iaf793857f7e0faae02c672b9f1d45a0658143a51
Diffstat (limited to 'src/compiler/codegen')
-rw-r--r--src/compiler/codegen/arm/assemble_arm.cc28
-rw-r--r--src/compiler/codegen/arm/codegen_arm.h1
-rw-r--r--src/compiler/codegen/arm/fp_arm.cc27
-rw-r--r--src/compiler/codegen/codegen.h7
-rw-r--r--src/compiler/codegen/codegen_util.cc32
-rw-r--r--src/compiler/codegen/gen_common.cc125
-rw-r--r--src/compiler/codegen/mips/assemble_mips.cc28
-rw-r--r--src/compiler/codegen/mips/codegen_mips.h1
-rw-r--r--src/compiler/codegen/mips/fp_mips.cc31
-rw-r--r--src/compiler/codegen/x86/assemble_x86.cc29
-rw-r--r--src/compiler/codegen/x86/codegen_x86.h1
-rw-r--r--src/compiler/codegen/x86/fp_x86.cc25
12 files changed, 90 insertions, 245 deletions
diff --git a/src/compiler/codegen/arm/assemble_arm.cc b/src/compiler/codegen/arm/assemble_arm.cc
index 93c979b9d3..27544d82ec 100644
--- a/src/compiler/codegen/arm/assemble_arm.cc
+++ b/src/compiler/codegen/arm/assemble_arm.cc
@@ -1366,32 +1366,4 @@ int ArmCodegen::GetInsnSize(LIR* lir)
return EncodingMap[lir->opcode].size;
}
-/*
- * Target-dependent offset assignment.
- */
-int ArmCodegen::AssignInsnOffsets(CompilationUnit* cu)
-{
- LIR* arm_lir;
- int offset = 0;
-
- for (arm_lir = cu->first_lir_insn; arm_lir != NULL; arm_lir = NEXT_LIR(arm_lir)) {
- arm_lir->offset = offset;
- if (arm_lir->opcode >= 0) {
- if (!arm_lir->flags.is_nop) {
- offset += arm_lir->flags.size;
- }
- } else if (arm_lir->opcode == kPseudoPseudoAlign4) {
- if (offset & 0x2) {
- offset += 2;
- arm_lir->operands[0] = 1;
- } else {
- arm_lir->operands[0] = 0;
- }
- }
- /* Pseudo opcodes don't consume space */
- }
-
- return offset;
-}
-
} // namespace art
diff --git a/src/compiler/codegen/arm/codegen_arm.h b/src/compiler/codegen/arm/codegen_arm.h
index 4737d8c442..f085a19b3f 100644
--- a/src/compiler/codegen/arm/codegen_arm.h
+++ b/src/compiler/codegen/arm/codegen_arm.h
@@ -83,7 +83,6 @@ class ArmCodegen : public Codegen {
virtual void SetupTargetResourceMasks(CompilationUnit* cu, LIR* lir);
virtual const char* GetTargetInstFmt(int opcode);
virtual const char* GetTargetInstName(int opcode);
- virtual int AssignInsnOffsets(CompilationUnit* cu);
virtual std::string BuildInsnString(const char* fmt, LIR* lir, unsigned char* base_addr);
virtual uint64_t GetPCUseDefEncoding();
virtual uint64_t GetTargetInstFlags(int opcode);
diff --git a/src/compiler/codegen/arm/fp_arm.cc b/src/compiler/codegen/arm/fp_arm.cc
index a9ea9161f0..5e0e73d193 100644
--- a/src/compiler/codegen/arm/fp_arm.cc
+++ b/src/compiler/codegen/arm/fp_arm.cc
@@ -50,9 +50,14 @@ bool ArmCodegen::GenArithOpFloat(CompilationUnit* cu, Instruction::Code opcode,
break;
case Instruction::REM_FLOAT_2ADDR:
case Instruction::REM_FLOAT:
- case Instruction::NEG_FLOAT: {
- return GenArithOpFloatPortable(cu, opcode, rl_dest, rl_src1, rl_src2);
- }
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmodf), rl_src1, rl_src2, false);
+ rl_result = GetReturn(cu, true);
+ StoreValue(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_FLOAT:
+ GenNegFloat(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -89,9 +94,14 @@ bool ArmCodegen::GenArithOpDouble(CompilationUnit* cu, Instruction::Code opcode,
break;
case Instruction::REM_DOUBLE_2ADDR:
case Instruction::REM_DOUBLE:
- case Instruction::NEG_DOUBLE: {
- return GenArithOpDoublePortable(cu, opcode, rl_dest, rl_src1, rl_src2);
- }
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmod), rl_src1, rl_src2, false);
+ rl_result = GetReturnWide(cu, true);
+ StoreValueWide(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_DOUBLE:
+ GenNegDouble(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -136,10 +146,13 @@ bool ArmCodegen::GenConversion(CompilationUnit* cu, Instruction::Code opcode,
op = kThumb2VcvtDI;
break;
case Instruction::LONG_TO_DOUBLE:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2d), rl_dest, rl_src);
case Instruction::FLOAT_TO_LONG:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2l), rl_dest, rl_src);
case Instruction::LONG_TO_FLOAT:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2f), rl_dest, rl_src);
case Instruction::DOUBLE_TO_LONG:
- return GenConversionPortable(cu, opcode, rl_dest, rl_src);
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2l), rl_dest, rl_src);
default:
return true;
}
diff --git a/src/compiler/codegen/codegen.h b/src/compiler/codegen/codegen.h
index 9bc306d35d..9dfa6091c3 100644
--- a/src/compiler/codegen/codegen.h
+++ b/src/compiler/codegen/codegen.h
@@ -153,12 +153,6 @@ class Codegen {
RegLocation rl_src1, RegLocation rl_src2);
bool GenConversionCall(CompilationUnit* cu, int func_offset, RegLocation rl_dest,
RegLocation rl_src);
- bool GenArithOpFloatPortable(CompilationUnit* cu, Instruction::Code opcode, RegLocation rl_dest,
- RegLocation rl_src1, RegLocation rl_src2);
- bool GenArithOpDoublePortable(CompilationUnit* cu, Instruction::Code opcode, RegLocation rl_dest,
- RegLocation rl_src1, RegLocation rl_src2);
- bool GenConversionPortable(CompilationUnit* cu, Instruction::Code opcode, RegLocation rl_dest,
- RegLocation rl_src);
void GenSuspendTest(CompilationUnit* cu, int opt_flags);
void GenSuspendTestAndBranch(CompilationUnit* cu, int opt_flags, LIR* target);
@@ -294,7 +288,6 @@ class Codegen {
virtual void SetupTargetResourceMasks(CompilationUnit* cu, LIR* lir) = 0;
virtual const char* GetTargetInstFmt(int opcode) = 0;
virtual const char* GetTargetInstName(int opcode) = 0;
- virtual int AssignInsnOffsets(CompilationUnit* cu) = 0;
virtual std::string BuildInsnString(const char* fmt, LIR* lir, unsigned char* base_addr) = 0;
virtual uint64_t GetPCUseDefEncoding() = 0;
virtual uint64_t GetTargetInstFlags(int opcode) = 0;
diff --git a/src/compiler/codegen/codegen_util.cc b/src/compiler/codegen/codegen_util.cc
index cf69ff989b..11ab9c0a96 100644
--- a/src/compiler/codegen/codegen_util.cc
+++ b/src/compiler/codegen/codegen_util.cc
@@ -863,14 +863,39 @@ static int AssignFillArrayDataOffset(CompilationUnit* cu, int offset)
return offset;
}
+// LIR offset assignment.
+static int AssignInsnOffsets(CompilationUnit* cu)
+{
+ LIR* lir;
+ int offset = 0;
+
+ for (lir = cu->first_lir_insn; lir != NULL; lir = NEXT_LIR(lir)) {
+ lir->offset = offset;
+ if (lir->opcode >= 0) {
+ if (!lir->flags.is_nop) {
+ offset += lir->flags.size;
+ }
+ } else if (lir->opcode == kPseudoPseudoAlign4) {
+ if (offset & 0x2) {
+ offset += 2;
+ lir->operands[0] = 1;
+ } else {
+ lir->operands[0] = 0;
+ }
+ }
+ /* Pseudo opcodes don't consume space */
+ }
+
+ return offset;
+}
+
/*
* Walk the compilation unit and assign offsets to instructions
* and literals and compute the total size of the compiled unit.
*/
static void AssignOffsets(CompilationUnit* cu)
{
- Codegen* cg = cu->cg.get();
- int offset = cg->AssignInsnOffsets(cu);
+ int offset = AssignInsnOffsets(cu);
/* Const values have to be word aligned */
offset = (offset + 3) & ~3;
@@ -1056,5 +1081,4 @@ LIR* MarkBoundary(CompilationUnit* cu, int offset, const char* inst_str)
return res;
}
-}
- // namespace art
+} // namespace art
diff --git a/src/compiler/codegen/gen_common.cc b/src/compiler/codegen/gen_common.cc
index 8605b8009c..db99a306e1 100644
--- a/src/compiler/codegen/gen_common.cc
+++ b/src/compiler/codegen/gen_common.cc
@@ -1924,131 +1924,6 @@ bool Codegen::GenConversionCall(CompilationUnit* cu, int func_offset,
return false;
}
-bool Codegen::GenArithOpFloatPortable(CompilationUnit* cu, Instruction::Code opcode,
- RegLocation rl_dest, RegLocation rl_src1,
- RegLocation rl_src2)
-{
- RegLocation rl_result;
- int func_offset;
-
- switch (opcode) {
- case Instruction::ADD_FLOAT_2ADDR:
- case Instruction::ADD_FLOAT:
- func_offset = ENTRYPOINT_OFFSET(pFadd);
- break;
- case Instruction::SUB_FLOAT_2ADDR:
- case Instruction::SUB_FLOAT:
- func_offset = ENTRYPOINT_OFFSET(pFsub);
- break;
- case Instruction::DIV_FLOAT_2ADDR:
- case Instruction::DIV_FLOAT:
- func_offset = ENTRYPOINT_OFFSET(pFdiv);
- break;
- case Instruction::MUL_FLOAT_2ADDR:
- case Instruction::MUL_FLOAT:
- func_offset = ENTRYPOINT_OFFSET(pFmul);
- break;
- case Instruction::REM_FLOAT_2ADDR:
- case Instruction::REM_FLOAT:
- func_offset = ENTRYPOINT_OFFSET(pFmodf);
- break;
- case Instruction::NEG_FLOAT: {
- GenNegFloat(cu, rl_dest, rl_src1);
- return false;
- }
- default:
- return true;
- }
- FlushAllRegs(cu); /* Send everything to home location */
- CallRuntimeHelperRegLocationRegLocation(cu, func_offset, rl_src1, rl_src2, false);
- rl_result = GetReturn(cu, true);
- StoreValue(cu, rl_dest, rl_result);
- return false;
-}
-
-bool Codegen::GenArithOpDoublePortable(CompilationUnit* cu, Instruction::Code opcode,
- RegLocation rl_dest, RegLocation rl_src1,
- RegLocation rl_src2)
-{
- RegLocation rl_result;
- int func_offset;
-
- switch (opcode) {
- case Instruction::ADD_DOUBLE_2ADDR:
- case Instruction::ADD_DOUBLE:
- func_offset = ENTRYPOINT_OFFSET(pDadd);
- break;
- case Instruction::SUB_DOUBLE_2ADDR:
- case Instruction::SUB_DOUBLE:
- func_offset = ENTRYPOINT_OFFSET(pDsub);
- break;
- case Instruction::DIV_DOUBLE_2ADDR:
- case Instruction::DIV_DOUBLE:
- func_offset = ENTRYPOINT_OFFSET(pDdiv);
- break;
- case Instruction::MUL_DOUBLE_2ADDR:
- case Instruction::MUL_DOUBLE:
- func_offset = ENTRYPOINT_OFFSET(pDmul);
- break;
- case Instruction::REM_DOUBLE_2ADDR:
- case Instruction::REM_DOUBLE:
- func_offset = ENTRYPOINT_OFFSET(pFmod);
- break;
- case Instruction::NEG_DOUBLE: {
- GenNegDouble(cu, rl_dest, rl_src1);
- return false;
- }
- default:
- return true;
- }
- FlushAllRegs(cu); /* Send everything to home location */
- CallRuntimeHelperRegLocationRegLocation(cu, func_offset, rl_src1, rl_src2, false);
- rl_result = GetReturnWide(cu, true);
- StoreValueWide(cu, rl_dest, rl_result);
- return false;
-}
-
-bool Codegen::GenConversionPortable(CompilationUnit* cu, Instruction::Code opcode,
- RegLocation rl_dest, RegLocation rl_src)
-{
-
- switch (opcode) {
- case Instruction::INT_TO_FLOAT:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pI2f),
- rl_dest, rl_src);
- case Instruction::FLOAT_TO_INT:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2iz),
- rl_dest, rl_src);
- case Instruction::DOUBLE_TO_FLOAT:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2f),
- rl_dest, rl_src);
- case Instruction::FLOAT_TO_DOUBLE:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2d),
- rl_dest, rl_src);
- case Instruction::INT_TO_DOUBLE:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pI2d),
- rl_dest, rl_src);
- case Instruction::DOUBLE_TO_INT:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2iz),
- rl_dest, rl_src);
- case Instruction::FLOAT_TO_LONG:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2l),
- rl_dest, rl_src);
- case Instruction::LONG_TO_FLOAT:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2f),
- rl_dest, rl_src);
- case Instruction::DOUBLE_TO_LONG:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2l),
- rl_dest, rl_src);
- case Instruction::LONG_TO_DOUBLE:
- return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2d),
- rl_dest, rl_src);
- default:
- return true;
- }
- return false;
-}
-
/* Check if we need to check for pending suspend request */
void Codegen::GenSuspendTest(CompilationUnit* cu, int opt_flags)
{
diff --git a/src/compiler/codegen/mips/assemble_mips.cc b/src/compiler/codegen/mips/assemble_mips.cc
index 4574a42118..c0ed3b68ba 100644
--- a/src/compiler/codegen/mips/assemble_mips.cc
+++ b/src/compiler/codegen/mips/assemble_mips.cc
@@ -712,33 +712,5 @@ int MipsCodegen::GetInsnSize(LIR* lir)
{
return EncodingMap[lir->opcode].size;
}
-/*
- * Target-dependent offset assignment.
- * independent.
- */
-int MipsCodegen::AssignInsnOffsets(CompilationUnit* cu)
-{
- LIR* mips_lir;
- int offset = 0;
-
- for (mips_lir = cu->first_lir_insn; mips_lir != NULL; mips_lir = NEXT_LIR(mips_lir)) {
- mips_lir->offset = offset;
- if (mips_lir->opcode >= 0) {
- if (!mips_lir->flags.is_nop) {
- offset += mips_lir->flags.size;
- }
- } else if (mips_lir->opcode == kPseudoPseudoAlign4) {
- if (offset & 0x2) {
- offset += 2;
- mips_lir->operands[0] = 1;
- } else {
- mips_lir->operands[0] = 0;
- }
- }
- /* Pseudo opcodes don't consume space */
- }
-
- return offset;
-}
} // namespace art
diff --git a/src/compiler/codegen/mips/codegen_mips.h b/src/compiler/codegen/mips/codegen_mips.h
index b0ecfce105..aaa03c053d 100644
--- a/src/compiler/codegen/mips/codegen_mips.h
+++ b/src/compiler/codegen/mips/codegen_mips.h
@@ -83,7 +83,6 @@ class MipsCodegen : public Codegen {
virtual void SetupTargetResourceMasks(CompilationUnit* cu, LIR* lir);
virtual const char* GetTargetInstFmt(int opcode);
virtual const char* GetTargetInstName(int opcode);
- virtual int AssignInsnOffsets(CompilationUnit* cu);
virtual std::string BuildInsnString(const char* fmt, LIR* lir, unsigned char* base_addr);
virtual uint64_t GetPCUseDefEncoding();
virtual uint64_t GetTargetInstFlags(int opcode);
diff --git a/src/compiler/codegen/mips/fp_mips.cc b/src/compiler/codegen/mips/fp_mips.cc
index efc4f80fcf..e718c5cfd4 100644
--- a/src/compiler/codegen/mips/fp_mips.cc
+++ b/src/compiler/codegen/mips/fp_mips.cc
@@ -49,11 +49,14 @@ bool MipsCodegen::GenArithOpFloat(CompilationUnit *cu, Instruction::Code opcode,
case Instruction::MUL_FLOAT:
op = kMipsFmuls;
break;
- case Instruction::REM_FLOAT_2ADDR:
- case Instruction::REM_FLOAT:
- case Instruction::NEG_FLOAT: {
- return GenArithOpFloatPortable(cu, opcode, rl_dest, rl_src1, rl_src2);
- }
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmodf), rl_src1, rl_src2, false);
+ rl_result = GetReturn(cu, true);
+ StoreValue(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_FLOAT:
+ GenNegFloat(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -91,9 +94,14 @@ bool MipsCodegen::GenArithOpDouble(CompilationUnit *cu, Instruction::Code opcode
break;
case Instruction::REM_DOUBLE_2ADDR:
case Instruction::REM_DOUBLE:
- case Instruction::NEG_DOUBLE: {
- return GenArithOpDoublePortable(cu, opcode, rl_dest, rl_src1, rl_src2);
- }
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmod), rl_src1, rl_src2, false);
+ rl_result = GetReturnWide(cu, true);
+ StoreValueWide(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_DOUBLE:
+ GenNegDouble(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -130,12 +138,17 @@ bool MipsCodegen::GenConversion(CompilationUnit *cu, Instruction::Code opcode, R
op = kMipsFcvtdw;
break;
case Instruction::FLOAT_TO_INT:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2iz), rl_dest, rl_src);
case Instruction::DOUBLE_TO_INT:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2iz), rl_dest, rl_src);
case Instruction::LONG_TO_DOUBLE:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2d), rl_dest, rl_src);
case Instruction::FLOAT_TO_LONG:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2l), rl_dest, rl_src);
case Instruction::LONG_TO_FLOAT:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2f), rl_dest, rl_src);
case Instruction::DOUBLE_TO_LONG:
- return GenConversionPortable(cu, opcode, rl_dest, rl_src);
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2l), rl_dest, rl_src);
default:
return true;
}
diff --git a/src/compiler/codegen/x86/assemble_x86.cc b/src/compiler/codegen/x86/assemble_x86.cc
index 1e04e18f97..2b33090d05 100644
--- a/src/compiler/codegen/x86/assemble_x86.cc
+++ b/src/compiler/codegen/x86/assemble_x86.cc
@@ -1417,33 +1417,4 @@ AssemblerStatus X86Codegen::AssembleInstructions(CompilationUnit *cu, uintptr_t
return res;
}
-/*
- * Target-dependent offset assignment.
- * independent.
- */
-int X86Codegen::AssignInsnOffsets(CompilationUnit* cu)
-{
- LIR* x86_lir;
- int offset = 0;
-
- for (x86_lir = cu->first_lir_insn; x86_lir != NULL; x86_lir = NEXT_LIR(x86_lir)) {
- x86_lir->offset = offset;
- if (x86_lir->opcode >= 0) {
- if (!x86_lir->flags.is_nop) {
- offset += x86_lir->flags.size;
- }
- } else if (x86_lir->opcode == kPseudoPseudoAlign4) {
- if (offset & 0x2) {
- offset += 2;
- x86_lir->operands[0] = 1;
- } else {
- x86_lir->operands[0] = 0;
- }
- }
- /* Pseudo opcodes don't consume space */
- }
-
- return offset;
-}
-
} // namespace art
diff --git a/src/compiler/codegen/x86/codegen_x86.h b/src/compiler/codegen/x86/codegen_x86.h
index 2a01d9ad1f..dba4953c61 100644
--- a/src/compiler/codegen/x86/codegen_x86.h
+++ b/src/compiler/codegen/x86/codegen_x86.h
@@ -83,7 +83,6 @@ class X86Codegen : public Codegen {
virtual void SetupTargetResourceMasks(CompilationUnit* cu, LIR* lir);
virtual const char* GetTargetInstFmt(int opcode);
virtual const char* GetTargetInstName(int opcode);
- virtual int AssignInsnOffsets(CompilationUnit* cu);
virtual std::string BuildInsnString(const char* fmt, LIR* lir, unsigned char* base_addr);
virtual uint64_t GetPCUseDefEncoding();
virtual uint64_t GetTargetInstFlags(int opcode);
diff --git a/src/compiler/codegen/x86/fp_x86.cc b/src/compiler/codegen/x86/fp_x86.cc
index 14f8b92b32..78c737d555 100644
--- a/src/compiler/codegen/x86/fp_x86.cc
+++ b/src/compiler/codegen/x86/fp_x86.cc
@@ -47,10 +47,16 @@ bool X86Codegen::GenArithOpFloat(CompilationUnit *cu, Instruction::Code opcode,
case Instruction::MUL_FLOAT:
op = kX86MulssRR;
break;
- case Instruction::NEG_FLOAT:
case Instruction::REM_FLOAT_2ADDR:
case Instruction::REM_FLOAT:
- return GenArithOpFloatPortable(cu, opcode, rl_dest, rl_src1, rl_src2);
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmodf), rl_src1, rl_src2, false);
+ rl_result = GetReturn(cu, true);
+ StoreValue(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_FLOAT:
+ GenNegFloat(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -93,10 +99,16 @@ bool X86Codegen::GenArithOpDouble(CompilationUnit *cu, Instruction::Code opcode,
case Instruction::MUL_DOUBLE:
op = kX86MulsdRR;
break;
- case Instruction::NEG_DOUBLE:
case Instruction::REM_DOUBLE_2ADDR:
case Instruction::REM_DOUBLE:
- return GenArithOpDoublePortable(cu, opcode, rl_dest, rl_src1, rl_src2);
+ FlushAllRegs(cu); // Send everything to home location
+ CallRuntimeHelperRegLocationRegLocation(cu, ENTRYPOINT_OFFSET(pFmod), rl_src1, rl_src2, false);
+ rl_result = GetReturnWide(cu, true);
+ StoreValueWide(cu, rl_dest, rl_result);
+ return false;
+ case Instruction::NEG_DOUBLE:
+ GenNegDouble(cu, rl_dest, rl_src1);
+ return false;
default:
return true;
}
@@ -186,11 +198,14 @@ bool X86Codegen::GenConversion(CompilationUnit *cu, Instruction::Code opcode, Re
return false;
}
case Instruction::LONG_TO_DOUBLE:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2d), rl_dest, rl_src);
case Instruction::LONG_TO_FLOAT:
// TODO: inline by using memory as a 64-bit source. Be careful about promoted registers.
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pL2f), rl_dest, rl_src);
case Instruction::FLOAT_TO_LONG:
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pF2l), rl_dest, rl_src);
case Instruction::DOUBLE_TO_LONG:
- return GenConversionPortable(cu, opcode, rl_dest, rl_src);
+ return GenConversionCall(cu, ENTRYPOINT_OFFSET(pD2l), rl_dest, rl_src);
default:
return true;
}