Home | History | Annotate | Download | only in Mips32

Lines Matching full:cunit

49 static int genTraceProfileEntry(CompilationUnit *cUnit)
53 MipsLIR *executionCount = newLIR1(cUnit, kMips32BitData, addr);
54 cUnit->chainCellOffsetLIR =
55 (LIR *) newLIR1(cUnit, kMips32BitData, CHAIN_CELL_OFFSET_TAG);
56 cUnit->headerSize = 8;
59 MipsLIR *loadAddr = newLIR2(cUnit, kMipsLahi, r_A0, 0);
61 loadAddr = newLIR3(cUnit, kMipsLalo, r_A0, r_A0, 0);
63 newLIR3(cUnit, kMipsLw, r_A0, 0, r_A0);
64 newLIR3(cUnit, kMipsLw, r_A1, 0, r_A0);
65 newLIR3(cUnit, kMipsAddiu, r_A1, r_A1, 1);
66 newLIR3(cUnit, kMipsSw, r_A1, 0, r_A0);
70 newLIR1(cUnit, kMipsJal,
72 newLIR0(cUnit, kMipsNop); /* delay slot */
81 static void genNegFloat(CompilationUnit *cUnit, RegLocation rlDest,
85 rlSrc = loadValue(cUnit, rlSrc, kCoreReg);
86 rlResult = dvmCompilerEvalLoc(cUnit, rlDest, kCoreReg, true);
87 opRegRegImm(cUnit, kOpAdd, rlResult.lowReg,
89 storeValue(cUnit, rlDest, rlResult);
92 static void genNegDouble(CompilationUnit *cUnit, RegLocation rlDest,
96 rlSrc = loadValueWide(cUnit, rlSrc, kCoreReg);
97 rlResult = dvmCompilerEvalLoc(cUnit, rlDest, kCoreReg, true);
98 opRegRegImm(cUnit, kOpAdd, rlResult.highReg, rlSrc.highReg,
100 genRegCopy(cUnit, rlResult.lowReg, rlSrc.lowReg);
101 storeValueWide(cUnit, rlDest, rlResult);
104 static void genMulLong(CompilationUnit *cUnit, RegLocation rlDest,
108 loadValueDirectWideFixed(cUnit, rlSrc1, r_ARG0, r_ARG1);
109 loadValueDirectWideFixed(cUnit, rlSrc2, r_ARG2, r_ARG3);
110 genDispatchToHandler(cUnit, TEMPLATE_MUL_LONG);
111 rlResult = dvmCompilerGetReturnWide(cUnit);
112 storeValueWide(cUnit, rlDest, rlResult);
120 static void withCarryHelper(CompilationUnit *cUnit, MipsOpCode opc,
124 int tReg = dvmCompilerAllocTemp(cUnit);
125 newLIR3(cUnit, opc, rlDest.lowReg, rlSrc1.lowReg, rlSrc2.lowReg);
126 newLIR3(cUnit, kMipsSltu, tReg, sltuSrc1, sltuSrc2);
127 newLIR3(cUnit, opc, rlDest.highReg, rlSrc1.highReg, rlSrc2.highReg);
128 newLIR3(cUnit, opc, rlDest.highReg, rlDest.highReg, tReg);
129 dvmCompilerFreeTemp(cUnit, tReg);
132 static void genLong3Addr(CompilationUnit *cUnit, MIR *mir, OpKind firstOp,
143 genInterpSingleStep(cUnit, mir);
145 rlResult = loadValueWide(cUnit, rlDest, kCoreReg);
146 rlSrc2 = loadValueWide(cUnit, rlSrc2, kCoreReg);
148 opRegRegReg(cUnit, firstOp, rlResult.lowReg, rlResult.lowReg, rlSrc2.lowReg);
149 opRegRegReg(cUnit, secondOp, rlResult.highReg, rlResult.highReg, rlSrc2.highReg);
151 withCarryHelper(cUnit, kMipsAddu, rlResult, rlResult, rlSrc2,
154 int tReg = dvmCompilerAllocTemp(cUnit);
155 newLIR2(cUnit, kMipsMove, tReg, rlResult.lowReg);
156 withCarryHelper(cUnit, kMipsSubu, rlResult, rlResult, rlSrc2,
158 dvmCompilerFreeTemp(cUnit, tReg);
160 storeValueWide(cUnit, rlDest, rlResult);
162 rlResult = loadValueWide(cUnit, rlDest, kCoreReg);
163 rlSrc1 = loadValueWide(cUnit, rlSrc1, kCoreReg);
165 opRegRegReg(cUnit, firstOp, rlResult.lowReg, rlSrc1.lowReg, rlResult.lowReg);
166 opRegRegReg(cUnit, secondOp, rlResult.highReg, rlSrc1.highReg, rlResult.highReg);
168 withCarryHelper(cUnit, kMipsAddu, rlResult, rlSrc1, rlResult,
171 withCarryHelper(cUnit, kMipsSubu, rlResult, rlSrc1, rlResult,
174 storeValueWide(cUnit, rlDest, rlResult);
176 rlSrc1 = loadValueWide(cUnit, rlSrc1, kCoreReg);
177 rlSrc2 = loadValueWide(cUnit, rlSrc2, kCoreReg);
178 rlResult = dvmCompilerEvalLoc(cUnit, rlDest, kCoreReg, true);
180 opRegRegReg(cUnit, firstOp, rlResult.lowReg, rlSrc1.lowReg, rlSrc2.lowReg);
181 opRegRegReg(cUnit, secondOp, rlResult.highReg, rlSrc1.highReg, rlSrc2.highReg);
183 withCarryHelper(cUnit, kMipsAddu, rlResult, rlSrc1, rlSrc2,
186 withCarryHelper(cUnit, kMipsSubu, rlResult, rlSrc1, rlSrc2,
189 storeValueWide(cUnit, rlDest, rlResult);
193 void dvmCompilerInitializeRegAlloc(CompilationUnit *cUnit)
197 cUnit->regPool = pool;
214 dvmCompilerAllocBitVector(cUnit->numSSARegs, false);
218 static MipsLIR *genExportPC(CompilationUnit *cUnit, MIR *mir)
221 int rDPC = dvmCompilerAllocTemp(cUnit);
222 int rAddr = dvmCompilerAllocTemp(cUnit);
224 res = loadConstant(cUnit, rDPC, (int) (cUnit->method->insns + mir->offset));
225 newLIR3(cUnit, kMipsAddiu, rAddr, rFP, -(sizeof(StackSaveArea) - offset));
226 storeWordDisp( cUnit, rAddr, 0, rDPC);
230 static void genMonitor(CompilationUnit *cUnit, MIR *mir)
232 genMonitorPortable(cUnit, mir);
235 static void genCmpLong(CompilationUnit *cUnit, MIR *mir, RegLocation rlDest,
239 loadValueDirectWideFixed(cUnit, rlSrc1, r_ARG0, r_ARG1);
240 loadValueDirectWideFixed(cUnit, rlSrc2, r_ARG2, r_ARG3);
241 genDispatchToHandler(cUnit, TEMPLATE_CMP_LONG);
242 rlResult = dvmCompilerGetReturn(cUnit);
243 storeValue(cUnit, rlDest, rlResult);
246 static bool genInlinedAbsFloat(CompilationUnit *cUnit, MIR *mir)
249 RegLocation rlSrc = dvmCompilerGetSrc(cUnit, mir, 0);
250 int reg0 = loadValue(cUnit, rlSrc, kCoreReg).lowReg;
252 newLIR4(cUnit, kMipsExt, reg0, reg0, 0, 31-1 /* size-1 */);
254 newLIR2(cUnit, kMipsSll, reg0, 1);
255 newLIR2(cUnit, kMipsSrl, reg0, 1);
257 storeWordDisp(cUnit, rSELF, offset, reg0);
259 dvmCompilerClobber(cUnit, reg0);
263 static bool genInlinedAbsDouble(CompilationUnit *cUnit, MIR *mir)
266 RegLocation rlSrc = dvmCompilerGetSrcWide(cUnit, mir, 0, 1);
267 RegLocation regSrc = loadValueWide(cUnit, rlSrc, kCoreReg);
270 storeWordDisp(cUnit, rSELF, offset + LOWORD_OFFSET, reglo);
272 newLIR4(cUnit, kMipsExt, reghi, reghi, 0, 31-1 /* size-1 */);
274 newLIR2(cUnit, kMipsSll, reghi, 1);
275 newLIR2(cUnit, kMipsSrl, reghi, 1);
277 storeWordDisp(cUnit, rSELF, offset + HIWORD_OFFSET, reghi);
279 dvmCompilerClobber(cUnit, reghi);
284 static bool genInlinedMinMaxInt(CompilationUnit *cUnit, MIR *mir, bool isMin)
287 RegLocation rlSrc1 = dvmCompilerGetSrc(cUnit, mir, 0);
288 RegLocation rlSrc2 = dvmCompilerGetSrc(cUnit, mir, 1);
289 int reg0 = loadValue(cUnit, rlSrc1, kCoreReg).lowReg;
290 int reg1 = loadValue(cUnit, rlSrc2, kCoreReg).lowReg;
291 int tReg = dvmCompilerAllocTemp(cUnit);
293 newLIR3(cUnit, kMipsSlt, tReg, reg0, reg1);
296 newLIR3(cUnit, kMipsSlt, tReg, reg1, reg0);
298 newLIR3(cUnit, kMipsMovz, reg0, reg1, tReg);
299 dvmCompilerFreeTemp(cUnit, tReg);
300 newLIR3(cUnit, kMipsSw, reg0, offset, rSELF);
302 dvmCompilerClobber(cUnit,reg0);
306 static void genMultiplyByTwoBitMultiplier(CompilationUnit *cUnit,
312 opRegRegImm(cUnit, kOpMul, rlResult.lowReg, rlSrc.lowReg, lit);