Quick compiler: minor cleanup
Remove dead software floating point support.
Move a common function from target specific to target independent.
Change-Id: Iaf793857f7e0faae02c672b9f1d45a0658143a51
diff --git a/src/compiler/codegen/codegen_util.cc b/src/compiler/codegen/codegen_util.cc
index cf69ff9..11ab9c0 100644
--- a/src/compiler/codegen/codegen_util.cc
+++ b/src/compiler/codegen/codegen_util.cc
@@ -863,14 +863,39 @@
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 @@
return res;
}
-}
- // namespace art
+} // namespace art