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/Thumb2/Factory.cc b/src/compiler/codegen/arm/Thumb2/Factory.cc
index 78b9e61..254802d 100644
--- a/src/compiler/codegen/arm/Thumb2/Factory.cc
+++ b/src/compiler/codegen/arm/Thumb2/Factory.cc
@@ -619,7 +619,7 @@
     if (zeroes != 0)
         return -1;
     if (bitB) {
-        if ((notBitB != 0) || (bSmear != 0x1f))
+        if ((notBitB != 0) || (bSmear != 0xff))
             return -1;
     } else {
         if ((notBitB != 1) || (bSmear != 0x0))
@@ -642,9 +642,29 @@
 {
     int encodedImm = encodeImmDouble(valLo, valHi);
     ArmLIR* res;
-    if (FPREG(rDestLo) && (encodedImm >= 0)) {
-        res = newLIR2(cUnit, kThumb2Vmovd_IMM8, S2D(rDestLo, rDestHi),
-                      encodedImm);
+    if (FPREG(rDestLo)) {
+        if (encodedImm >= 0) {
+            res = newLIR2(cUnit, kThumb2Vmovd_IMM8, S2D(rDestLo, rDestHi),
+                          encodedImm);
+        } else {
+            ArmLIR* dataTarget = scanLiteralPoolWide(cUnit->literalList, valLo,
+               valHi);
+            if (dataTarget == NULL) {
+                dataTarget = addWideData(cUnit, &cUnit->literalList, valLo,
+                                         valHi);
+            }
+            ArmLIR* loadPcRel = (ArmLIR* ) oatNew(sizeof(ArmLIR), true);
+            loadPcRel->generic.dalvikOffset = cUnit->currentDalvikOffset;
+            loadPcRel->opcode = kThumb2Vldrd;
+            loadPcRel->generic.target = (LIR* ) dataTarget;
+            loadPcRel->operands[0] = S2D(rDestLo, rDestHi);
+            loadPcRel->operands[1] = r15pc;
+            setupResourceMasks(loadPcRel);
+            setMemRefType(loadPcRel, true, kLiteral);
+            loadPcRel->aliasInfo = dataTarget->operands[0];
+            oatAppendLIR(cUnit, (LIR* ) loadPcRel);
+            res = loadPcRel;
+        }
     } else {
         res = loadConstantNoClobber(cUnit, rDestLo, valLo);
         loadConstantNoClobber(cUnit, rDestHi, valHi);
diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc
index 52d67de..2404ca7 100644
--- a/src/compiler/codegen/arm/Thumb2/Gen.cc
+++ b/src/compiler/codegen/arm/Thumb2/Gen.cc
@@ -283,7 +283,7 @@
         rKey = tmp;
     }
     // Materialize a pointer to the switch table
-    newLIR3(cUnit, kThumb2AdrST, rBase, 0, (intptr_t)tabRec);
+    newLIR3(cUnit, kThumb2Adr, rBase, 0, (intptr_t)tabRec);
     // Set up rIdx
     int rIdx = oatAllocTemp(cUnit);
     loadConstant(cUnit, rIdx, size);
@@ -324,7 +324,7 @@
     rlSrc = loadValue(cUnit, rlSrc, kCoreReg);
     int tableBase = oatAllocTemp(cUnit);
     // Materialize a pointer to the switch table
-    newLIR3(cUnit, kThumb2AdrST, tableBase, 0, (intptr_t)tabRec);
+    newLIR3(cUnit, kThumb2Adr, tableBase, 0, (intptr_t)tabRec);
     int lowKey = s4FromSwitchData(&table[2]);
     int keyReg;
     // Remove the bias, if necessary
@@ -383,7 +383,7 @@
     loadWordDisp(cUnit, rSELF,
                  OFFSETOF_MEMBER(Thread, pHandleFillArrayDataFromCode), rLR);
     // Materialize a pointer to the fill data image
-    newLIR3(cUnit, kThumb2AdrST, r1, 0, (intptr_t)tabRec);
+    newLIR3(cUnit, kThumb2Adr, r1, 0, (intptr_t)tabRec);
     callUnwindableHelper(cUnit, rLR);
     oatClobberCallRegs(cUnit);
 }