buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
buzbee | b046e16 | 2012-10-30 15:48:42 -0700 | [diff] [blame] | 17 | /* This file contains codegen for the Mips ISA */ |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 18 | |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 19 | #include "oat/runtime/oat_support_entrypoints.h" |
| 20 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 21 | namespace art { |
| 22 | |
buzbee | 16da88c | 2012-03-20 10:38:17 -0700 | [diff] [blame] | 23 | void genSpecialCase(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir, |
| 24 | SpecialCaseHandler specialCase) |
| 25 | { |
| 26 | // TODO |
| 27 | } |
| 28 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 29 | /* |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 30 | * The lack of pc-relative loads on Mips presents somewhat of a challenge |
| 31 | * for our PIC switch table strategy. To materialize the current location |
| 32 | * we'll do a dummy JAL and reference our tables using r_RA as the |
| 33 | * base register. Note that r_RA will be used both as the base to |
| 34 | * locate the switch table data and as the reference base for the switch |
| 35 | * target offsets stored in the table. We'll use a special pseudo-instruction |
| 36 | * to represent the jal and trigger the construction of the |
| 37 | * switch table offsets (which will happen after final assembly and all |
| 38 | * labels are fixed). |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 39 | * |
| 40 | * The test loop will look something like: |
| 41 | * |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 42 | * ori rEnd, r_ZERO, #tableSize ; size in bytes |
| 43 | * jal BaseLabel ; stores "return address" (BaseLabel) in r_RA |
| 44 | * nop ; opportunistically fill |
| 45 | * BaseLabel: |
| 46 | * addiu rBase, r_RA, <table> - <BaseLabel> ; table relative to BaseLabel |
| 47 | addu rEnd, rEnd, rBase ; end of table |
| 48 | * lw rVal, [rSP, vRegOff] ; Test Value |
| 49 | * loop: |
| 50 | * beq rBase, rEnd, done |
| 51 | * lw rKey, 0(rBase) |
| 52 | * addu rBase, 8 |
| 53 | * bne rVal, rKey, loop |
| 54 | * lw rDisp, -4(rBase) |
| 55 | * addu r_RA, rDisp |
| 56 | * jr r_RA |
| 57 | * done: |
| 58 | * |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 59 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 60 | void genSparseSwitch(CompilationUnit* cUnit, uint32_t tableOffset, |
buzbee | a1da8a5 | 2012-07-09 14:00:21 -0700 | [diff] [blame] | 61 | RegLocation rlSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 62 | { |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 63 | const u2* table = cUnit->insns + cUnit->currentDalvikOffset + tableOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 64 | if (cUnit->printMe) { |
| 65 | dumpSparseSwitchTable(table); |
| 66 | } |
| 67 | // Add the table to the list - we'll process it later |
| 68 | SwitchTable *tabRec = (SwitchTable *)oatNew(cUnit, sizeof(SwitchTable), |
| 69 | true, kAllocData); |
| 70 | tabRec->table = table; |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 71 | tabRec->vaddr = cUnit->currentDalvikOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 72 | int elements = table[1]; |
| 73 | tabRec->targets = (LIR* *)oatNew(cUnit, elements * sizeof(LIR*), true, |
| 74 | kAllocLIR); |
| 75 | oatInsertGrowableList(cUnit, &cUnit->switchTables, (intptr_t)tabRec); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 76 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 77 | // The table is composed of 8-byte key/disp pairs |
| 78 | int byteSize = elements * 8; |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 79 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 80 | int sizeHi = byteSize >> 16; |
| 81 | int sizeLo = byteSize & 0xffff; |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 82 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 83 | int rEnd = oatAllocTemp(cUnit); |
| 84 | if (sizeHi) { |
| 85 | newLIR2(cUnit, kMipsLui, rEnd, sizeHi); |
| 86 | } |
| 87 | // Must prevent code motion for the curr pc pair |
| 88 | genBarrier(cUnit); // Scheduling barrier |
| 89 | newLIR0(cUnit, kMipsCurrPC); // Really a jal to .+8 |
| 90 | // Now, fill the branch delay slot |
| 91 | if (sizeHi) { |
| 92 | newLIR3(cUnit, kMipsOri, rEnd, rEnd, sizeLo); |
| 93 | } else { |
| 94 | newLIR3(cUnit, kMipsOri, rEnd, r_ZERO, sizeLo); |
| 95 | } |
| 96 | genBarrier(cUnit); // Scheduling barrier |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 97 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 98 | // Construct BaseLabel and set up table base register |
| 99 | LIR* baseLabel = newLIR0(cUnit, kPseudoTargetLabel); |
| 100 | // Remember base label so offsets can be computed later |
| 101 | tabRec->anchor = baseLabel; |
| 102 | int rBase = oatAllocTemp(cUnit); |
| 103 | newLIR4(cUnit, kMipsDelta, rBase, 0, (intptr_t)baseLabel, (intptr_t)tabRec); |
| 104 | opRegRegReg(cUnit, kOpAdd, rEnd, rEnd, rBase); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 105 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 106 | // Grab switch test value |
| 107 | rlSrc = loadValue(cUnit, rlSrc, kCoreReg); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 108 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 109 | // Test loop |
| 110 | int rKey = oatAllocTemp(cUnit); |
| 111 | LIR* loopLabel = newLIR0(cUnit, kPseudoTargetLabel); |
| 112 | LIR* exitBranch = opCmpBranch(cUnit , kCondEq, rBase, rEnd, NULL); |
| 113 | loadWordDisp(cUnit, rBase, 0, rKey); |
| 114 | opRegImm(cUnit, kOpAdd, rBase, 8); |
| 115 | opCmpBranch(cUnit, kCondNe, rlSrc.lowReg, rKey, loopLabel); |
| 116 | int rDisp = oatAllocTemp(cUnit); |
| 117 | loadWordDisp(cUnit, rBase, -4, rDisp); |
| 118 | opRegRegReg(cUnit, kOpAdd, r_RA, r_RA, rDisp); |
| 119 | opReg(cUnit, kOpBx, r_RA); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 120 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 121 | // Loop exit |
| 122 | LIR* exitLabel = newLIR0(cUnit, kPseudoTargetLabel); |
| 123 | exitBranch->target = exitLabel; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 124 | } |
| 125 | |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 126 | /* |
| 127 | * Code pattern will look something like: |
| 128 | * |
| 129 | * lw rVal |
| 130 | * jal BaseLabel ; stores "return address" (BaseLabel) in r_RA |
| 131 | * nop ; opportunistically fill |
| 132 | * [subiu rVal, bias] ; Remove bias if lowVal != 0 |
| 133 | * bound check -> done |
| 134 | * lw rDisp, [r_RA, rVal] |
| 135 | * addu r_RA, rDisp |
| 136 | * jr r_RA |
| 137 | * done: |
| 138 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 139 | void genPackedSwitch(CompilationUnit* cUnit, uint32_t tableOffset, |
| 140 | RegLocation rlSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 141 | { |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 142 | const u2* table = cUnit->insns + cUnit->currentDalvikOffset + tableOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 143 | if (cUnit->printMe) { |
| 144 | dumpPackedSwitchTable(table); |
| 145 | } |
| 146 | // Add the table to the list - we'll process it later |
| 147 | SwitchTable *tabRec = (SwitchTable *)oatNew(cUnit, sizeof(SwitchTable), |
| 148 | true, kAllocData); |
| 149 | tabRec->table = table; |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 150 | tabRec->vaddr = cUnit->currentDalvikOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 151 | int size = table[1]; |
| 152 | tabRec->targets = (LIR* *)oatNew(cUnit, size * sizeof(LIR*), true, |
| 153 | kAllocLIR); |
| 154 | oatInsertGrowableList(cUnit, &cUnit->switchTables, (intptr_t)tabRec); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 155 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 156 | // Get the switch value |
| 157 | rlSrc = loadValue(cUnit, rlSrc, kCoreReg); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 158 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 159 | // Prepare the bias. If too big, handle 1st stage here |
| 160 | int lowKey = s4FromSwitchData(&table[2]); |
| 161 | bool largeBias = false; |
| 162 | int rKey; |
| 163 | if (lowKey == 0) { |
| 164 | rKey = rlSrc.lowReg; |
| 165 | } else if ((lowKey & 0xffff) != lowKey) { |
| 166 | rKey = oatAllocTemp(cUnit); |
| 167 | loadConstant(cUnit, rKey, lowKey); |
| 168 | largeBias = true; |
| 169 | } else { |
| 170 | rKey = oatAllocTemp(cUnit); |
| 171 | } |
| 172 | |
| 173 | // Must prevent code motion for the curr pc pair |
| 174 | genBarrier(cUnit); |
| 175 | newLIR0(cUnit, kMipsCurrPC); // Really a jal to .+8 |
| 176 | // Now, fill the branch delay slot with bias strip |
| 177 | if (lowKey == 0) { |
| 178 | newLIR0(cUnit, kMipsNop); |
| 179 | } else { |
| 180 | if (largeBias) { |
| 181 | opRegRegReg(cUnit, kOpSub, rKey, rlSrc.lowReg, rKey); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 182 | } else { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 183 | opRegRegImm(cUnit, kOpSub, rKey, rlSrc.lowReg, lowKey); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 184 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 185 | } |
| 186 | genBarrier(cUnit); // Scheduling barrier |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 187 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 188 | // Construct BaseLabel and set up table base register |
| 189 | LIR* baseLabel = newLIR0(cUnit, kPseudoTargetLabel); |
| 190 | // Remember base label so offsets can be computed later |
| 191 | tabRec->anchor = baseLabel; |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 192 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 193 | // Bounds check - if < 0 or >= size continue following switch |
| 194 | LIR* branchOver = opCmpImmBranch(cUnit, kCondHi, rKey, size-1, NULL); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 195 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 196 | // Materialize the table base pointer |
| 197 | int rBase = oatAllocTemp(cUnit); |
| 198 | newLIR4(cUnit, kMipsDelta, rBase, 0, (intptr_t)baseLabel, (intptr_t)tabRec); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 199 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 200 | // Load the displacement from the switch table |
| 201 | int rDisp = oatAllocTemp(cUnit); |
| 202 | loadBaseIndexed(cUnit, rBase, rKey, rDisp, 2, kWord); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 203 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 204 | // Add to r_AP and go |
| 205 | opRegRegReg(cUnit, kOpAdd, r_RA, r_RA, rDisp); |
| 206 | opReg(cUnit, kOpBx, r_RA); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 207 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 208 | /* branchOver target here */ |
| 209 | LIR* target = newLIR0(cUnit, kPseudoTargetLabel); |
| 210 | branchOver->target = (LIR*)target; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | /* |
| 214 | * Array data table format: |
| 215 | * ushort ident = 0x0300 magic value |
| 216 | * ushort width width of each element in the table |
| 217 | * uint size number of elements in the table |
| 218 | * ubyte data[size*width] table of data values (may contain a single-byte |
| 219 | * padding at the end) |
| 220 | * |
| 221 | * Total size is 4+(width * size + 1)/2 16-bit code units. |
| 222 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 223 | void genFillArrayData(CompilationUnit* cUnit, uint32_t tableOffset, |
| 224 | RegLocation rlSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 225 | { |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 226 | const u2* table = cUnit->insns + cUnit->currentDalvikOffset + tableOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 227 | // Add the table to the list - we'll process it later |
| 228 | FillArrayData *tabRec = (FillArrayData *) |
| 229 | oatNew(cUnit, sizeof(FillArrayData), true, kAllocData); |
| 230 | tabRec->table = table; |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 231 | tabRec->vaddr = cUnit->currentDalvikOffset; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 232 | u2 width = tabRec->table[1]; |
| 233 | u4 size = tabRec->table[2] | (((u4)tabRec->table[3]) << 16); |
| 234 | tabRec->size = (size * width) + 8; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 235 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 236 | oatInsertGrowableList(cUnit, &cUnit->fillArrayData, (intptr_t)tabRec); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 237 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 238 | // Making a call - use explicit registers |
| 239 | oatFlushAllRegs(cUnit); /* Everything to home location */ |
| 240 | oatLockCallTemps(cUnit); |
| 241 | loadValueDirectFixed(cUnit, rlSrc, rARG0); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 242 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 243 | // Must prevent code motion for the curr pc pair |
| 244 | genBarrier(cUnit); |
| 245 | newLIR0(cUnit, kMipsCurrPC); // Really a jal to .+8 |
| 246 | // Now, fill the branch delay slot with the helper load |
| 247 | int rTgt = loadHelper(cUnit, ENTRYPOINT_OFFSET(pHandleFillArrayDataFromCode)); |
| 248 | genBarrier(cUnit); // Scheduling barrier |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 249 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 250 | // Construct BaseLabel and set up table base register |
| 251 | LIR* baseLabel = newLIR0(cUnit, kPseudoTargetLabel); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 252 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 253 | // Materialize a pointer to the fill data image |
| 254 | newLIR4(cUnit, kMipsDelta, rARG1, 0, (intptr_t)baseLabel, (intptr_t)tabRec); |
buzbee | c5159d5 | 2012-03-03 11:48:39 -0800 | [diff] [blame] | 255 | |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 256 | // And go... |
| 257 | oatClobberCalleeSave(cUnit); |
buzbee | 8320f38 | 2012-09-11 16:29:42 -0700 | [diff] [blame] | 258 | LIR* callInst = opReg(cUnit, kOpBlx, rTgt); // ( array*, fill_data* ) |
| 259 | markSafepointPC(cUnit, callInst); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 260 | } |
| 261 | |
buzbee | 71ac994 | 2012-03-01 17:23:10 -0800 | [diff] [blame] | 262 | void genNegFloat(CompilationUnit *cUnit, RegLocation rlDest, RegLocation rlSrc) |
| 263 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 264 | RegLocation rlResult; |
| 265 | rlSrc = loadValue(cUnit, rlSrc, kCoreReg); |
| 266 | rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 267 | opRegRegImm(cUnit, kOpAdd, rlResult.lowReg, rlSrc.lowReg, 0x80000000); |
| 268 | storeValue(cUnit, rlDest, rlResult); |
buzbee | 71ac994 | 2012-03-01 17:23:10 -0800 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | void genNegDouble(CompilationUnit *cUnit, RegLocation rlDest, RegLocation rlSrc) |
| 272 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 273 | RegLocation rlResult; |
| 274 | rlSrc = loadValueWide(cUnit, rlSrc, kCoreReg); |
| 275 | rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 276 | opRegRegImm(cUnit, kOpAdd, rlResult.highReg, rlSrc.highReg, 0x80000000); |
| 277 | opRegCopy(cUnit, rlResult.lowReg, rlSrc.lowReg); |
| 278 | storeValueWide(cUnit, rlDest, rlResult); |
buzbee | 71ac994 | 2012-03-01 17:23:10 -0800 | [diff] [blame] | 279 | } |
| 280 | |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 281 | /* |
| 282 | * TODO: implement fast path to short-circuit thin-lock case |
| 283 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 284 | void genMonitorEnter(CompilationUnit* cUnit, int optFlags, RegLocation rlSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 285 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 286 | oatFlushAllRegs(cUnit); |
| 287 | loadValueDirectFixed(cUnit, rlSrc, rARG0); // Get obj |
| 288 | oatLockCallTemps(cUnit); // Prepare for explicit register usage |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 289 | genNullCheck(cUnit, rlSrc.sRegLow, rARG0, optFlags); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 290 | // Go expensive route - artLockObjectFromCode(self, obj); |
| 291 | int rTgt = loadHelper(cUnit, ENTRYPOINT_OFFSET(pLockObjectFromCode)); |
| 292 | oatClobberCalleeSave(cUnit); |
buzbee | 8320f38 | 2012-09-11 16:29:42 -0700 | [diff] [blame] | 293 | LIR* callInst = opReg(cUnit, kOpBlx, rTgt); |
| 294 | markSafepointPC(cUnit, callInst); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 295 | } |
| 296 | |
| 297 | /* |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 298 | * TODO: implement fast path to short-circuit thin-lock case |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 299 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 300 | void genMonitorExit(CompilationUnit* cUnit, int optFlags, RegLocation rlSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 301 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 302 | oatFlushAllRegs(cUnit); |
| 303 | loadValueDirectFixed(cUnit, rlSrc, rARG0); // Get obj |
| 304 | oatLockCallTemps(cUnit); // Prepare for explicit register usage |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 305 | genNullCheck(cUnit, rlSrc.sRegLow, rARG0, optFlags); |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 306 | // Go expensive route - UnlockObjectFromCode(obj); |
| 307 | int rTgt = loadHelper(cUnit, ENTRYPOINT_OFFSET(pUnlockObjectFromCode)); |
| 308 | oatClobberCalleeSave(cUnit); |
buzbee | 8320f38 | 2012-09-11 16:29:42 -0700 | [diff] [blame] | 309 | LIR* callInst = opReg(cUnit, kOpBlx, rTgt); |
| 310 | markSafepointPC(cUnit, callInst); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 311 | } |
| 312 | |
| 313 | /* |
| 314 | * Compare two 64-bit values |
| 315 | * x = y return 0 |
| 316 | * x < y return -1 |
| 317 | * x > y return 1 |
| 318 | * |
| 319 | * slt t0, x.hi, y.hi; # (x.hi < y.hi) ? 1:0 |
| 320 | * sgt t1, x.hi, y.hi; # (y.hi > x.hi) ? 1:0 |
| 321 | * subu res, t0, t1 # res = -1:1:0 for [ < > = ] |
| 322 | * bnez res, finish |
| 323 | * sltu t0, x.lo, y.lo |
| 324 | * sgtu r1, x.lo, y.lo |
| 325 | * subu res, t0, t1 |
| 326 | * finish: |
| 327 | * |
| 328 | */ |
buzbee | 408ad16 | 2012-06-06 16:45:18 -0700 | [diff] [blame] | 329 | void genCmpLong(CompilationUnit* cUnit, RegLocation rlDest, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 330 | RegLocation rlSrc1, RegLocation rlSrc2) |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 331 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 332 | rlSrc1 = loadValueWide(cUnit, rlSrc1, kCoreReg); |
| 333 | rlSrc2 = loadValueWide(cUnit, rlSrc2, kCoreReg); |
| 334 | int t0 = oatAllocTemp(cUnit); |
| 335 | int t1 = oatAllocTemp(cUnit); |
| 336 | RegLocation rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 337 | newLIR3(cUnit, kMipsSlt, t0, rlSrc1.highReg, rlSrc2.highReg); |
| 338 | newLIR3(cUnit, kMipsSlt, t1, rlSrc2.highReg, rlSrc1.highReg); |
| 339 | newLIR3(cUnit, kMipsSubu, rlResult.lowReg, t1, t0); |
| 340 | LIR* branch = opCmpImmBranch(cUnit, kCondNe, rlResult.lowReg, 0, NULL); |
| 341 | newLIR3(cUnit, kMipsSltu, t0, rlSrc1.lowReg, rlSrc2.lowReg); |
| 342 | newLIR3(cUnit, kMipsSltu, t1, rlSrc2.lowReg, rlSrc1.lowReg); |
| 343 | newLIR3(cUnit, kMipsSubu, rlResult.lowReg, t1, t0); |
| 344 | oatFreeTemp(cUnit, t0); |
| 345 | oatFreeTemp(cUnit, t1); |
| 346 | LIR* target = newLIR0(cUnit, kPseudoTargetLabel); |
| 347 | branch->target = (LIR*)target; |
| 348 | storeValue(cUnit, rlDest, rlResult); |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 349 | } |
| 350 | |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 351 | LIR* opCmpBranch(CompilationUnit* cUnit, ConditionCode cond, int src1, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 352 | int src2, LIR* target) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 353 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 354 | LIR* branch; |
| 355 | MipsOpCode sltOp; |
| 356 | MipsOpCode brOp; |
| 357 | bool cmpZero = false; |
| 358 | bool swapped = false; |
| 359 | switch (cond) { |
| 360 | case kCondEq: |
| 361 | brOp = kMipsBeq; |
| 362 | cmpZero = true; |
| 363 | break; |
| 364 | case kCondNe: |
| 365 | brOp = kMipsBne; |
| 366 | cmpZero = true; |
| 367 | break; |
| 368 | case kCondCc: |
| 369 | sltOp = kMipsSltu; |
| 370 | brOp = kMipsBnez; |
| 371 | break; |
| 372 | case kCondCs: |
| 373 | sltOp = kMipsSltu; |
| 374 | brOp = kMipsBeqz; |
| 375 | break; |
| 376 | case kCondGe: |
| 377 | sltOp = kMipsSlt; |
| 378 | brOp = kMipsBeqz; |
| 379 | break; |
| 380 | case kCondGt: |
| 381 | sltOp = kMipsSlt; |
| 382 | brOp = kMipsBnez; |
| 383 | swapped = true; |
| 384 | break; |
| 385 | case kCondLe: |
| 386 | sltOp = kMipsSlt; |
| 387 | brOp = kMipsBeqz; |
| 388 | swapped = true; |
| 389 | break; |
| 390 | case kCondLt: |
| 391 | sltOp = kMipsSlt; |
| 392 | brOp = kMipsBnez; |
| 393 | break; |
| 394 | case kCondHi: // Gtu |
| 395 | sltOp = kMipsSltu; |
| 396 | brOp = kMipsBnez; |
| 397 | swapped = true; |
| 398 | break; |
| 399 | default: |
| 400 | LOG(FATAL) << "No support for ConditionCode: " << (int) cond; |
| 401 | return NULL; |
| 402 | } |
| 403 | if (cmpZero) { |
| 404 | branch = newLIR2(cUnit, brOp, src1, src2); |
| 405 | } else { |
| 406 | int tReg = oatAllocTemp(cUnit); |
| 407 | if (swapped) { |
| 408 | newLIR3(cUnit, sltOp, tReg, src2, src1); |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 409 | } else { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 410 | newLIR3(cUnit, sltOp, tReg, src1, src2); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 411 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 412 | branch = newLIR1(cUnit, brOp, tReg); |
| 413 | oatFreeTemp(cUnit, tReg); |
| 414 | } |
| 415 | branch->target = target; |
| 416 | return branch; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 417 | } |
| 418 | |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 419 | LIR* opCmpImmBranch(CompilationUnit* cUnit, ConditionCode cond, int reg, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 420 | int checkValue, LIR* target) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 421 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 422 | LIR* branch; |
| 423 | if (checkValue != 0) { |
| 424 | // TUNING: handle s16 & kCondLt/Mi case using slti |
| 425 | int tReg = oatAllocTemp(cUnit); |
| 426 | loadConstant(cUnit, tReg, checkValue); |
| 427 | branch = opCmpBranch(cUnit, cond, reg, tReg, target); |
| 428 | oatFreeTemp(cUnit, tReg); |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 429 | return branch; |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 430 | } |
| 431 | MipsOpCode opc; |
| 432 | switch (cond) { |
| 433 | case kCondEq: opc = kMipsBeqz; break; |
| 434 | case kCondGe: opc = kMipsBgez; break; |
| 435 | case kCondGt: opc = kMipsBgtz; break; |
| 436 | case kCondLe: opc = kMipsBlez; break; |
| 437 | //case KCondMi: |
| 438 | case kCondLt: opc = kMipsBltz; break; |
| 439 | case kCondNe: opc = kMipsBnez; break; |
| 440 | default: |
| 441 | // Tuning: use slti when applicable |
| 442 | int tReg = oatAllocTemp(cUnit); |
| 443 | loadConstant(cUnit, tReg, checkValue); |
| 444 | branch = opCmpBranch(cUnit, cond, reg, tReg, target); |
| 445 | oatFreeTemp(cUnit, tReg); |
| 446 | return branch; |
| 447 | } |
| 448 | branch = newLIR1(cUnit, opc, reg); |
| 449 | branch->target = target; |
| 450 | return branch; |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 451 | } |
| 452 | |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 453 | LIR* opRegCopyNoInsert(CompilationUnit *cUnit, int rDest, int rSrc) |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 454 | { |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 455 | #ifdef __mips_hard_float |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 456 | if (FPREG(rDest) || FPREG(rSrc)) |
| 457 | return fpRegCopy(cUnit, rDest, rSrc); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 458 | #endif |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 459 | LIR* res = rawLIR(cUnit, cUnit->currentDalvikOffset, kMipsMove, |
| 460 | rDest, rSrc); |
| 461 | if (!(cUnit->disableOpt & (1 << kSafeOptimizations)) && rDest == rSrc) { |
| 462 | res->flags.isNop = true; |
| 463 | } |
| 464 | return res; |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 465 | } |
| 466 | |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 467 | LIR* opRegCopy(CompilationUnit *cUnit, int rDest, int rSrc) |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 468 | { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 469 | LIR *res = opRegCopyNoInsert(cUnit, rDest, rSrc); |
| 470 | oatAppendLIR(cUnit, (LIR*)res); |
| 471 | return res; |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 472 | } |
| 473 | |
buzbee | 82488f5 | 2012-03-02 08:20:26 -0800 | [diff] [blame] | 474 | void opRegCopyWide(CompilationUnit *cUnit, int destLo, int destHi, |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 475 | int srcLo, int srcHi) |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 476 | { |
| 477 | #ifdef __mips_hard_float |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 478 | bool destFP = FPREG(destLo) && FPREG(destHi); |
| 479 | bool srcFP = FPREG(srcLo) && FPREG(srcHi); |
| 480 | assert(FPREG(srcLo) == FPREG(srcHi)); |
| 481 | assert(FPREG(destLo) == FPREG(destHi)); |
| 482 | if (destFP) { |
| 483 | if (srcFP) { |
| 484 | opRegCopy(cUnit, S2D(destLo, destHi), S2D(srcLo, srcHi)); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 485 | } else { |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 486 | /* note the operands are swapped for the mtc1 instr */ |
| 487 | newLIR2(cUnit, kMipsMtc1, srcLo, destLo); |
| 488 | newLIR2(cUnit, kMipsMtc1, srcHi, destHi); |
buzbee | 5de3494 | 2012-03-01 14:51:57 -0800 | [diff] [blame] | 489 | } |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 490 | } else { |
| 491 | if (srcFP) { |
| 492 | newLIR2(cUnit, kMipsMfc1, destLo, srcLo); |
| 493 | newLIR2(cUnit, kMipsMfc1, destHi, srcHi); |
| 494 | } else { |
| 495 | // Handle overlap |
| 496 | if (srcHi == destLo) { |
| 497 | opRegCopy(cUnit, destHi, srcHi); |
| 498 | opRegCopy(cUnit, destLo, srcLo); |
| 499 | } else { |
| 500 | opRegCopy(cUnit, destLo, srcLo); |
| 501 | opRegCopy(cUnit, destHi, srcHi); |
| 502 | } |
| 503 | } |
| 504 | } |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 505 | #else |
Bill Buzbee | a114add | 2012-05-03 15:00:40 -0700 | [diff] [blame] | 506 | // Handle overlap |
| 507 | if (srcHi == destLo) { |
| 508 | opRegCopy(cUnit, destHi, srcHi); |
| 509 | opRegCopy(cUnit, destLo, srcLo); |
| 510 | } else { |
| 511 | opRegCopy(cUnit, destLo, srcLo); |
| 512 | opRegCopy(cUnit, destHi, srcHi); |
| 513 | } |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 514 | #endif |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 515 | } |
| 516 | |
jeffhao | 4b771a0 | 2012-07-25 15:07:21 -0700 | [diff] [blame] | 517 | void genFusedLongCmpBranch(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir) |
| 518 | { |
| 519 | UNIMPLEMENTED(FATAL) << "Need codegen for fused long cmp branch"; |
| 520 | } |
| 521 | |
buzbee | b046e16 | 2012-10-30 15:48:42 -0700 | [diff] [blame] | 522 | LIR* genRegMemCheck(CompilationUnit* cUnit, ConditionCode cCode, |
| 523 | int reg1, int base, int offset, ThrowKind kind) |
| 524 | { |
| 525 | LOG(FATAL) << "Unexpected use of genRegMemCheck for Arm"; |
| 526 | return NULL; |
| 527 | } |
| 528 | |
| 529 | RegLocation genDivRem(CompilationUnit* cUnit, RegLocation rlDest, int reg1, int reg2, bool isDiv) |
| 530 | { |
| 531 | newLIR4(cUnit, kMipsDiv, r_HI, r_LO, reg1, reg2); |
| 532 | RegLocation rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 533 | if (isDiv) { |
| 534 | newLIR2(cUnit, kMipsMflo, rlResult.lowReg, r_LO); |
| 535 | } else { |
| 536 | newLIR2(cUnit, kMipsMfhi, rlResult.lowReg, r_HI); |
| 537 | } |
| 538 | return rlResult; |
| 539 | } |
| 540 | |
| 541 | RegLocation genDivRemLit(CompilationUnit* cUnit, RegLocation rlDest, int reg1, int lit, bool isDiv) |
| 542 | { |
| 543 | int tReg = oatAllocTemp(cUnit); |
| 544 | newLIR3(cUnit, kMipsAddiu, tReg, r_ZERO, lit); |
| 545 | newLIR4(cUnit, kMipsDiv, r_HI, r_LO, reg1, tReg); |
| 546 | RegLocation rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true); |
| 547 | if (isDiv) { |
| 548 | newLIR2(cUnit, kMipsMflo, rlResult.lowReg, r_LO); |
| 549 | } else { |
| 550 | newLIR2(cUnit, kMipsMfhi, rlResult.lowReg, r_HI); |
| 551 | } |
| 552 | oatFreeTemp(cUnit, tReg); |
| 553 | return rlResult; |
| 554 | } |
| 555 | |
| 556 | /* |
| 557 | * Mark garbage collection card. Skip if the value we're storing is null. |
| 558 | */ |
| 559 | void markGCCard(CompilationUnit* cUnit, int valReg, int tgtAddrReg) |
| 560 | { |
| 561 | int regCardBase = oatAllocTemp(cUnit); |
| 562 | int regCardNo = oatAllocTemp(cUnit); |
| 563 | LIR* branchOver = opCmpImmBranch(cUnit, kCondEq, valReg, 0, NULL); |
| 564 | loadWordDisp(cUnit, rSELF, Thread::CardTableOffset().Int32Value(), regCardBase); |
| 565 | opRegRegImm(cUnit, kOpLsr, regCardNo, tgtAddrReg, CardTable::kCardShift); |
| 566 | storeBaseIndexed(cUnit, regCardBase, regCardNo, regCardBase, 0, |
| 567 | kUnsignedByte); |
| 568 | LIR* target = newLIR0(cUnit, kPseudoTargetLabel); |
| 569 | branchOver->target = (LIR*)target; |
| 570 | oatFreeTemp(cUnit, regCardBase); |
| 571 | oatFreeTemp(cUnit, regCardNo); |
| 572 | } |
| 573 | |
| 574 | bool genInlinedMinMaxInt(CompilationUnit *cUnit, CallInfo* info, bool isMin) |
| 575 | { |
| 576 | // TODO: need Mips implementation |
| 577 | return false; |
| 578 | } |
| 579 | |
| 580 | void opLea(CompilationUnit* cUnit, int rBase, int reg1, int reg2, int scale, int offset) |
| 581 | { |
| 582 | LOG(FATAL) << "Unexpected use of opLea for Arm"; |
| 583 | } |
| 584 | |
| 585 | void opTlsCmp(CompilationUnit* cUnit, int offset, int val) |
| 586 | { |
| 587 | LOG(FATAL) << "Unexpected use of opTlsCmp for Arm"; |
| 588 | } |
| 589 | |
| 590 | bool genInlinedCas32(CompilationUnit* cUnit, CallInfo* info, bool need_write_barrier) { |
| 591 | DCHECK_NE(cUnit->instructionSet, kThumb2); |
| 592 | return false; |
| 593 | } |
| 594 | |
| 595 | bool genInlinedSqrt(CompilationUnit* cUnit, CallInfo* info) { |
| 596 | DCHECK_NE(cUnit->instructionSet, kThumb2); |
| 597 | return false; |
| 598 | } |
| 599 | |
| 600 | LIR* opPcRelLoad(CompilationUnit* cUnit, int reg, LIR* target) { |
| 601 | LOG(FATAL) << "Unexpected use of opPcRelLoad for Mips"; |
| 602 | return NULL; |
| 603 | } |
| 604 | |
| 605 | LIR* opVldm(CompilationUnit* cUnit, int rBase, int count) |
| 606 | { |
| 607 | LOG(FATAL) << "Unexpected use of opVldm for Mips"; |
| 608 | return NULL; |
| 609 | } |
| 610 | |
| 611 | LIR* opVstm(CompilationUnit* cUnit, int rBase, int count) |
| 612 | { |
| 613 | LOG(FATAL) << "Unexpected use of opVstm for Mips"; |
| 614 | return NULL; |
| 615 | } |
| 616 | |
| 617 | void genMultiplyByTwoBitMultiplier(CompilationUnit* cUnit, RegLocation rlSrc, |
| 618 | RegLocation rlResult, int lit, |
| 619 | int firstBit, int secondBit) |
| 620 | { |
| 621 | int tReg = oatAllocTemp(cUnit); |
| 622 | opRegRegImm(cUnit, kOpLsl, tReg, rlSrc.lowReg, secondBit - firstBit); |
| 623 | opRegRegReg(cUnit, kOpAdd, rlResult.lowReg, rlSrc.lowReg, tReg); |
| 624 | oatFreeTemp(cUnit, tReg); |
| 625 | if (firstBit != 0) { |
| 626 | opRegRegImm(cUnit, kOpLsl, rlResult.lowReg, rlResult.lowReg, firstBit); |
| 627 | } |
| 628 | } |
| 629 | |
| 630 | void genDivZeroCheck(CompilationUnit* cUnit, int regLo, int regHi) |
| 631 | { |
| 632 | int tReg = oatAllocTemp(cUnit); |
| 633 | opRegRegReg(cUnit, kOpOr, tReg, regLo, regHi); |
| 634 | genImmedCheck(cUnit, kCondEq, tReg, 0, kThrowDivZero); |
| 635 | oatFreeTemp(cUnit, tReg); |
| 636 | } |
| 637 | |
| 638 | // Test suspend flag, return target of taken suspend branch |
| 639 | LIR* opTestSuspend(CompilationUnit* cUnit, LIR* target) |
| 640 | { |
| 641 | opRegImm(cUnit, kOpSub, rSUSPEND, 1); |
| 642 | return opCmpImmBranch(cUnit, (target == NULL) ? kCondEq : kCondNe, rSUSPEND, 0, target); |
| 643 | } |
| 644 | |
| 645 | // Decrement register and branch on condition |
| 646 | LIR* opDecAndBranch(CompilationUnit* cUnit, ConditionCode cCode, int reg, LIR* target) |
| 647 | { |
| 648 | opRegImm(cUnit, kOpSub, reg, 1); |
| 649 | return opCmpImmBranch(cUnit, cCode, reg, 0, target); |
| 650 | } |
| 651 | |
| 652 | bool smallLiteralDivide(CompilationUnit* cUnit, Instruction::Code dalvikOpcode, |
| 653 | RegLocation rlSrc, RegLocation rlDest, int lit) |
| 654 | { |
| 655 | LOG(FATAL) << "Unexpected use of smallLiteralDive in Mips"; |
| 656 | return false; |
| 657 | } |
| 658 | |
| 659 | LIR* opIT(CompilationUnit* cUnit, ArmConditionCode cond, const char* guide) |
| 660 | { |
| 661 | LOG(FATAL) << "Unexpected use of opIT in Mips"; |
| 662 | return NULL; |
| 663 | } |
| 664 | |
buzbee | e3acd07 | 2012-02-25 17:03:10 -0800 | [diff] [blame] | 665 | } // namespace art |