OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/mips64/constants-mips64.h" | 7 #include "src/mips64/constants-mips64.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 case TEQ: | 212 case TEQ: |
213 case TNE: | 213 case TNE: |
214 return true; | 214 return true; |
215 default: | 215 default: |
216 return false; | 216 return false; |
217 } | 217 } |
218 } | 218 } |
219 } | 219 } |
220 | 220 |
221 | 221 |
222 Instruction::Type Instruction::InstructionType() const { | |
223 switch (OpcodeFieldRaw()) { | |
224 case SPECIAL: | |
225 switch (FunctionFieldRaw()) { | |
226 case JR: | |
227 case JALR: | |
228 case BREAK: | |
229 case SLL: | |
230 case DSLL: | |
231 case DSLL32: | |
232 case SRL: | |
233 case DSRL: | |
234 case DSRL32: | |
235 case SRA: | |
236 case DSRA: | |
237 case DSRA32: | |
238 case SLLV: | |
239 case DSLLV: | |
240 case SRLV: | |
241 case DSRLV: | |
242 case SRAV: | |
243 case DSRAV: | |
244 case MFHI: | |
245 case MFLO: | |
246 case MULT: | |
247 case DMULT: | |
248 case MULTU: | |
249 case DMULTU: | |
250 case DIV: | |
251 case DDIV: | |
252 case DIVU: | |
253 case DDIVU: | |
254 case ADD: | |
255 case DADD: | |
256 case ADDU: | |
257 case DADDU: | |
258 case SUB: | |
259 case DSUB: | |
260 case SUBU: | |
261 case DSUBU: | |
262 case AND: | |
263 case OR: | |
264 case XOR: | |
265 case NOR: | |
266 case SLT: | |
267 case SLTU: | |
268 case TGE: | |
269 case TGEU: | |
270 case TLT: | |
271 case TLTU: | |
272 case TEQ: | |
273 case TNE: | |
274 case MOVZ: | |
275 case MOVN: | |
276 case MOVCI: | |
277 case SELEQZ_S: | |
278 case SELNEZ_S: | |
279 return kRegisterType; | |
280 default: | |
281 return kUnsupported; | |
282 } | |
283 break; | |
284 case SPECIAL2: | |
285 switch (FunctionFieldRaw()) { | |
286 case MUL: | |
287 case CLZ: | |
288 return kRegisterType; | |
289 default: | |
290 return kUnsupported; | |
291 } | |
292 break; | |
293 case SPECIAL3: | |
294 switch (FunctionFieldRaw()) { | |
295 case INS: | |
296 case EXT: | |
297 case DEXT: | |
298 return kRegisterType; | |
299 case BSHFL: { | |
300 int sa = SaFieldRaw() >> kSaShift; | |
301 switch (sa) { | |
302 case BITSWAP: | |
303 return kRegisterType; | |
304 case WSBH: | |
305 case SEB: | |
306 case SEH: | |
307 return kUnsupported; | |
308 } | |
309 sa >>= kBp2Bits; | |
310 switch (sa) { | |
311 case ALIGN: | |
312 return kRegisterType; | |
313 default: | |
314 return kUnsupported; | |
315 } | |
316 } | |
317 case DBSHFL: { | |
318 int sa = SaFieldRaw() >> kSaShift; | |
319 switch (sa) { | |
320 case DBITSWAP: | |
321 return kRegisterType; | |
322 case DSBH: | |
323 case DSHD: | |
324 return kUnsupported; | |
325 } | |
326 sa = SaFieldRaw() >> kSaShift; | |
327 sa >>= kBp3Bits; | |
328 switch (sa) { | |
329 case DALIGN: | |
330 return kRegisterType; | |
331 default: | |
332 return kUnsupported; | |
333 } | |
334 } | |
335 default: | |
336 return kUnsupported; | |
337 } | |
338 break; | |
339 case COP1: // Coprocessor instructions. | |
340 switch (RsFieldRawNoAssert()) { | |
341 case BC1: // Branch on coprocessor condition. | |
342 case BC1EQZ: | |
343 case BC1NEZ: | |
344 return kImmediateType; | |
345 default: | |
346 return kRegisterType; | |
347 } | |
348 break; | |
349 case COP1X: | |
350 return kRegisterType; | |
351 // 16 bits Immediate type instructions. e.g.: addi dest, src, imm16. | |
352 case REGIMM: | |
353 case BEQ: | |
354 case BNE: | |
355 case BLEZ: | |
356 case BGTZ: | |
357 case ADDI: | |
358 case DADDI: | |
359 case ADDIU: | |
360 case DADDIU: | |
361 case SLTI: | |
362 case SLTIU: | |
363 case ANDI: | |
364 case ORI: | |
365 case XORI: | |
366 case LUI: | |
367 case BEQL: | |
368 case BNEL: | |
369 case BLEZL: | |
370 case BGTZL: | |
371 case POP66: | |
372 case POP76: | |
373 case LB: | |
374 case LH: | |
375 case LWL: | |
376 case LW: | |
377 case LWU: | |
378 case LD: | |
379 case LBU: | |
380 case LHU: | |
381 case LWR: | |
382 case SB: | |
383 case SH: | |
384 case SWL: | |
385 case SW: | |
386 case SD: | |
387 case SWR: | |
388 case LWC1: | |
389 case LDC1: | |
390 case SWC1: | |
391 case SDC1: | |
392 case PCREL: | |
393 case BC: | |
394 case BALC: | |
395 return kImmediateType; | |
396 // 26 bits immediate type instructions. e.g.: j imm26. | |
397 case J: | |
398 case JAL: | |
399 return kJumpType; | |
400 default: | |
401 return kUnsupported; | |
402 } | |
403 return kUnsupported; | |
404 } | |
405 | |
406 | |
407 } // namespace internal | 222 } // namespace internal |
408 } // namespace v8 | 223 } // namespace v8 |
409 | 224 |
410 #endif // V8_TARGET_ARCH_MIPS64 | 225 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |