Lines Matching full:cunit
51 static ArmLIR *loadFPConstantValue(CompilationUnit *cUnit, int rDest,
57 return newLIR2(cUnit, kThumb2Vmovs_IMM8, rDest, encodedImm);
59 ArmLIR *dataTarget = scanLiteralPool(cUnit->literalList, value, 0);
61 dataTarget = addWordData(cUnit, &cUnit->literalList, value);
71 dvmCompilerAppendLIR(cUnit, (LIR *) loadPcRel);
136 static ArmLIR *loadConstantNoClobber(CompilationUnit *cUnit, int rDest,
143 return loadFPConstantValue(cUnit, rDest, value);
148 return newLIR2(cUnit, kThumbMovImm, rDest, value);
153 res = newLIR2(cUnit, kThumb2MovImmShift, rDest, modImm);
158 res = newLIR2(cUnit, kThumb2MvnImmShift, rDest, modImm);
163 res = newLIR2(cUnit, kThumb2MovImm16, rDest, value);
167 ArmLIR *dataTarget = scanLiteralPool(cUnit->literalList, value, 0);
169 dataTarget = addWordData(cUnit, &cUnit->literalList, value);
179 dvmCompilerAppendLIR(cUnit, (LIR *) loadPcRel);
186 opRegImm(cUnit, kOpAdd, rDest, value - dataTarget->operands[0]);
195 static ArmLIR *loadConstant(CompilationUnit *cUnit, int rDest, int value)
197 if (dvmCompilerIsTemp(cUnit, rDest)) {
198 dvmCompilerClobber(cUnit, rDest);
199 dvmCompilerMarkInUse(cUnit, rDest);
201 return loadConstantNoClobber(cUnit, rDest, value);
208 static ArmLIR *loadClassPointer(CompilationUnit *cUnit, int rDest, int value)
211 cUnit->hasClassLiterals = true;
212 if (dvmCompilerIsTemp(cUnit, rDest)) {
213 dvmCompilerClobber(cUnit, rDest);
214 dvmCompilerMarkInUse(cUnit, rDest);
216 ArmLIR *dataTarget = scanLiteralPool(cUnit->classPointerList, value, 0);
218 dataTarget = addWordData(cUnit, &cUnit->classPointerList, value);
220 cUnit->numClassPointers++;
230 dvmCompilerAppendLIR(cUnit, (LIR *) loadPcRel);
234 static ArmLIR *opNone(CompilationUnit *cUnit, OpKind op)
244 return newLIR0(cUnit, opcode);
247 static ArmLIR *opCondBranch(CompilationUnit *cUnit, ArmConditionCode cc)
249 return newLIR2(cUnit, kThumb2BCond, 0 /* offset to be patched */, cc);
252 static ArmLIR *opImm(CompilationUnit *cUnit, OpKind op, int value)
283 return newLIR1(cUnit, opcode, value);
286 static ArmLIR *opReg(CompilationUnit *cUnit, OpKind op, int rDestSrc)
296 return newLIR1(cUnit, opcode, rDestSrc);
299 static ArmLIR *opRegRegShift(CompilationUnit *cUnit, OpKind op, int rDestSrc1,
388 return newLIR4(cUnit, kThumb2Sbfx, rDestSrc1, rSrc2, 0, 8);
391 return newLIR4(cUnit, kThumb2Sbfx, rDestSrc1, rSrc2, 0, 16);
394 return newLIR4(cUnit, kThumb2Ubfx, rDestSrc1, rSrc2, 0, 16);
401 return newLIR2(cUnit, opcode, rDestSrc1, rSrc2);
404 return newLIR3(cUnit, opcode, rDestSrc1, rSrc2, shift);
406 return newLIR3(cUnit, opcode, rDestSrc1, rDestSrc1, rSrc2);
408 return newLIR4(cUnit, opcode, rDestSrc1, rDestSrc1, rSrc2, shift);
415 static ArmLIR *opRegReg(CompilationUnit *cUnit, OpKind op, int rDestSrc1,
418 return opRegRegShift(cUnit, op, rDestSrc1, rSrc2, 0);
421 static ArmLIR *opRegRegRegShift(CompilationUnit *cUnit, OpKind op,
478 return newLIR4(cUnit, opcode, rDest, rSrc1, rSrc2, shift);
481 return newLIR3(cUnit, opcode, rDest, rSrc1, rSrc2);
485 static ArmLIR *opRegRegReg(CompilationUnit *cUnit, OpKind op, int rDest,
488 return opRegRegRegShift(cUnit, op, rDest, rSrc1, rSrc2, 0);
491 static ArmLIR *opRegRegImm(CompilationUnit *cUnit, OpKind op, int rDest,
506 return newLIR3(cUnit, kThumbLslRRI5, rDest, rSrc1, value);
508 return newLIR3(cUnit
511 return newLIR3(cUnit, kThumbLsrRRI5, rDest, rSrc1, value);
513 return newLIR3(cUnit, kThumb2LsrRRI5, rDest, rSrc1, value);
516 return newLIR3(cUnit, kThumbAsrRRI5, rDest, rSrc1, value);
518 return newLIR3(cUnit, kThumb2AsrRRI5, rDest, rSrc1, value);
520 return newLIR3(cUnit, kThumb2RorRRI5, rDest, rSrc1, value);
524 return newLIR3(cUnit, kThumbAddSpRel, rDest, rSrc1,
528 return newLIR3(cUnit, kThumbAddPcRel, rDest, rSrc1,
540 return newLIR3(cUnit, opcode, rDest, rSrc1, absValue);
546 return newLIR3(cUnit, opcode, rDest, rSrc1, absValue);
586 res = newLIR2(cUnit, kThumb2CmpRI8, rSrc1, modImm);
588 int rTmp = dvmCompilerAllocTemp(cUnit);
589 res = loadConstant(cUnit, rTmp, value);
590 opRegReg(cUnit, kOpCmp, rSrc1, rTmp);
591 dvmCompilerFreeTemp(cUnit, rTmp);
600 return newLIR3(cUnit, opcode, rDest, rSrc1, modImm);
602 int rScratch = dvmCompilerAllocTemp(cUnit);
603 loadConstant(cUnit, rScratch, value);
605 res = newLIR4(cUnit, altOpcode, rDest, rSrc1, rScratch, 0);
607 res = newLIR3(cUnit, altOpcode, rDest, rSrc1, rScratch);
608 dvmCompilerFreeTemp(cUnit, rScratch);
614 static ArmLIR *opRegImm(CompilationUnit *cUnit, OpKind op, int rDestSrc1,
625 return newLIR1(cUnit, kThumbAddSpI7, value >> 2);
633 return newLIR1(cUnit, kThumbSubSpI7, value >> 2);
654 return newLIR2(cUnit, opcode, rDestSrc1, absValue);
656 return opRegRegImm(cUnit, op, rDestSrc1, rDestSrc1, value);
694 static ArmLIR *loadConstantValueWide(CompilationUnit *cUnit, int rDestLo,
700 res = newLIR2(cUnit, kThumb2Vmovd_IMM8, S2D(rDestLo, rDestHi),
703 res = loadConstantNoClobber(cUnit, rDestLo, valLo);
704 loadConstantNoClobber(cUnit, rDestHi, valHi);
713 static ArmLIR *loadBaseIndexed(CompilationUnit *cUnit, int rBase,
734 regPtr = dvmCompilerAllocTemp(cUnit);
736 newLIR4(cUnit, kThumb2AddRRR, regPtr, rBase, rIndex,
739 opRegRegReg(cUnit, kOpAdd, regPtr, rBase, rIndex);
741 load = newLIR3(cUnit, opcode, rDest, regPtr, 0);
743 if (cUnit->heapMemOp)
766 load = newLIR3(cUnit, opcode, rDest, rBase, rIndex);
768 load = newLIR4(cUnit, opcode, rDest, rBase, rIndex, scale);
771 if (cUnit->heapMemOp)
777 static ArmLIR *storeBaseIndexed(CompilationUnit *cUnit, int rBase,
798 regPtr = dvmCompilerAllocTemp(cUnit);
800 newLIR4(cUnit, kThumb2AddRRR, regPtr, rBase, rIndex,
803 opRegRegReg(cUnit, kOpAdd, regPtr, rBase, rIndex);
805 store = newLIR3(cUnit, opcode, rSrc, regPtr, 0);
807 if (cUnit->heapMemOp)
826 store = newLIR3(cUnit, opcode, rSrc, rBase, rIndex);
828 store = newLIR4(cUnit, opcode, rSrc, rBase, rIndex, scale);
831 if (cUnit->heapMemOp)
842 static ArmLIR *loadBaseDispBody(CompilationUnit *cUnit, MIR *mir, int rBase,
868 res = loadBaseDispBody(cUnit, mir, rBase, displacement, rDest,
870 loadBaseDispBody(cUnit, NULL, rBase, displacement + 4, rDestHi,
941 load = res = newLIR3(cUnit, opcode, rDest, rBase, encodedDisp);
943 int regOffset = dvmCompilerAllocTemp(cUnit);
944 res = loadConstant(cUnit, regOffset, encodedDisp);
945 load = loadBaseIndexed(cUnit, rBase, regOffset, rDest, 0, size);
946 dvmCompilerFreeTemp(cUnit, regOffset);
953 if (cUnit->heapMemOp)
959 static ArmLIR *loadBaseDisp(CompilationUnit *cUnit, MIR *mir, int rBase,
963 return loadBaseDispBody(cUnit, mir, rBase, displacement, rDest, -1,
967 static ArmLIR *loadBaseDispWide(CompilationUnit *cUnit, MIR *mir, int rBase,
971 return loadBaseDispBody(cUnit, mir, rBase, displacement, rDestLo, rDestHi,
976 static ArmLIR *storeBaseDispBody(CompilationUnit *cUnit, int rBase,
991 res = storeBaseDispBody(cUnit, rBase, displacement, rSrc,
993 storeBaseDispBody(cUnit, rBase, displacement + 4, rSrcHi,
1054 store = res = newLIR3(cUnit, opcode, rSrc, rBase, encodedDisp);
1056 int rScratch = dvmCompilerAllocTemp(cUnit);
1057 res = loadConstant(cUnit, rScratch, encodedDisp);
1058 store = storeBaseIndexed(cUnit, rBase, rScratch, rSrc, 0, size);
1059 dvmCompilerFreeTemp(cUnit, rScratch);
1066 if (cUnit->heapMemOp)
1072 static ArmLIR *storeBaseDisp(CompilationUnit *cUnit, int rBase,
1075 return storeBaseDispBody(cUnit, rBase, displacement, rSrc, -1, size);
1078 static ArmLIR *storeBaseDispWide(CompilationUnit *cUnit, int rBase,
1081 return storeBaseDispBody(cUnit, rBase, displacement, rSrcLo, rSrcHi, kLong);
1084 static ArmLIR *loadMultiple(CompilationUnit *cUnit, int rBase, int rMask)
1087 genBarrier(cUnit);
1089 res = newLIR2(cUnit, kThumbLdmia, rBase, rMask);
1091 res = newLIR2(cUnit, kThumb2Ldmia, rBase, rMask);
1094 if (cUnit->heapMemOp)
1097 genBarrier(cUnit);
1101 static ArmLIR *storeMultiple(CompilationUnit *cUnit, int rBase, int rMask)
1104 genBarrier(cUnit);
1106 res = newLIR2(cUnit, kThumbStmia, rBase, rMask);
1108 res = newLIR2(cUnit, kThumb2Stmia, rBase, rMask);
1111 if (cUnit->heapMemOp)
1114 genBarrier(cUnit);
1118 static void storePair(CompilationUnit *cUnit, int base, int lowReg, int highReg)
1120 storeBaseDispWide(cUnit, base, 0, lowReg, highReg);
1123 static void loadPair(CompilationUnit *cUnit, int base, int lowReg, int highReg)
1125 loadBaseDispWide(cUnit, NULL, base, 0, lowReg, highReg, INVALID_SREG);
1132 static ArmLIR *genCmpImmBranch(CompilationUnit *cUnit,
1140 branch = newLIR2(cUnit,
1146 newLIR2(cUnit, kThumbCmpRI8, reg, checkValue);
1148 newLIR2(cUnit, kThumb2CmpRI8, reg, modImm);
1150 int tReg = dvmCompilerAllocTemp(cUnit);
1151 loadConstant(cUnit, tReg, checkValue);
1152 opRegReg(cUnit, kOpCmp, reg, tReg);
1154 branch = newLIR2(cUnit, kThumbBCond, 0, cond);
1159 static ArmLIR *fpRegCopy(CompilationUnit *cUnit, int rDest, int rSrc)
1185 static ArmLIR* genRegCopyNoInsert(CompilationUnit *cUnit, int rDest, int rSrc)
1190 return fpRegCopy(cUnit, rDest, rSrc);
1211 static ArmLIR* genRegCopy(CompilationUnit *cUnit, int rDest, int rSrc)
1213 ArmLIR *res = genRegCopyNoInsert(cUnit, rDest, rSrc);
1214 dvmCompilerAppendLIR(cUnit, (LIR*)res);
1218 static void genRegCopyWide(CompilationUnit *cUnit, int destLo, int destHi,
1227 genRegCopy(cUnit, S2D(destLo, destHi), S2D(srcLo, srcHi));
1229 newLIR3(cUnit, kThumb2Fmdrr, S2D(destLo, destHi), srcLo, srcHi);
1233 newLIR3(cUnit, kThumb2Fmrrd, destLo, destHi, S2D(srcLo, srcHi));
1237 genRegCopy(cUnit, destHi, srcHi);
1238 genRegCopy(cUnit, destLo, srcLo);
1240 genRegCopy(cUnit, destLo, srcLo);
1241 genRegCopy(cUnit, destHi, srcHi);
1248 static void genSelfVerificationPreBranch(CompilationUnit *cUnit,
1258 static void genSelfVerificationPostBranch(CompilationUnit *cUnit,