Rework type & size inference, literal usage
Fixes a bug in the old type inference mechanism (wasn't properly
propogating type info across Phi & move nodes). Combined type and
size inferences passes.
Fixed long-standing bug in the code to load a special double-precision
immediate (would have been extremely difficult to hit this in the field).
Improved loading floating point immediates.
Change-Id: I1ec72edc3b25525f14d965089f8952d4f0294942
diff --git a/src/compiler/codegen/arm/CodegenCommon.cc b/src/compiler/codegen/arm/CodegenCommon.cc
index 4b9b592..40494f3 100644
--- a/src/compiler/codegen/arm/CodegenCommon.cc
+++ b/src/compiler/codegen/arm/CodegenCommon.cc
@@ -326,6 +326,25 @@
return NULL;
}
+/* Search the existing constants in the literal pool for an exact wide match */
+static ArmLIR* scanLiteralPoolWide(LIR* dataTarget, int valLo, int valHi)
+{
+ bool loMatch = false;
+ LIR* loTarget = NULL;
+ while (dataTarget) {
+ if (loMatch && (((ArmLIR*)dataTarget)->operands[0] == valHi)) {
+ return (ArmLIR*)loTarget;
+ }
+ loMatch = false;
+ if (((ArmLIR*)dataTarget)->operands[0] == valLo) {
+ loMatch = true;
+ loTarget = dataTarget;
+ }
+ dataTarget = dataTarget->next;
+ }
+ return NULL;
+}
+
/*
* The following are building blocks to insert constants into the pool or
* instruction streams.
@@ -350,6 +369,23 @@
return NULL;
}
+/* Add a 64-bit constant to the constant pool or mixed with code */
+static ArmLIR* addWideData(CompilationUnit* cUnit, LIR* *constantListP,
+ int valLo, int valHi)
+{
+ ArmLIR* res;
+ //NOTE: hard-coded little endian
+ if (constantListP == NULL) {
+ res = addWordData(cUnit, NULL, valLo);
+ addWordData(cUnit, NULL, valHi);
+ } else {
+ // Insert high word into list first
+ addWordData(cUnit, constantListP, valHi);
+ res = addWordData(cUnit, constantListP, valLo);
+ }
+ return res;
+}
+
/*
* Generate an kArmPseudoBarrier marker to indicate the boundary of special
* blocks.