Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: include/opcode/mips.h

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/opcode/metag.h ('k') | include/opcode/moxie.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
None
OLDNEW
1 /* mips.h. Mips opcode list for GDB, the GNU debugger. 1 /* mips.h. Mips opcode list for GDB, the GNU debugger.
2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2 Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
3 2003, 2004, 2005, 2008, 2009, 2010 3 2003, 2004, 2005, 2008, 2009, 2010, 2013
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 Contributed by Ralph Campbell and OSF 5 Contributed by Ralph Campbell and OSF
6 Commented and modified by Ian Lance Taylor, Cygnus Support 6 Commented and modified by Ian Lance Taylor, Cygnus Support
7 7
8 This file is part of GDB, GAS, and the GNU binutils. 8 This file is part of GDB, GAS, and the GNU binutils.
9 9
10 GDB, GAS, and the GNU binutils are free software; you can redistribute 10 GDB, GAS, and the GNU binutils are free software; you can redistribute
11 them and/or modify them under the terms of the GNU General Public 11 them and/or modify them under the terms of the GNU General Public
12 License as published by the Free Software Foundation; either version 3, 12 License as published by the Free Software Foundation; either version 3,
13 or (at your option) any later version. 13 or (at your option) any later version.
14 14
15 GDB, GAS, and the GNU binutils are distributed in the hope that they 15 GDB, GAS, and the GNU binutils are distributed in the hope that they
16 will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 the GNU General Public License for more details. 18 the GNU General Public License for more details.
19 19
20 You should have received a copy of the GNU General Public License 20 You should have received a copy of the GNU General Public License
21 along with this file; see the file COPYING3. If not, write to the Free 21 along with this file; see the file COPYING3. If not, write to the Free
22 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, 22 Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
23 MA 02110-1301, USA. */ 23 MA 02110-1301, USA. */
24 24
25 #ifndef _MIPS_H_ 25 #ifndef _MIPS_H_
26 #define _MIPS_H_ 26 #define _MIPS_H_
27 27
28 #include "bfd.h"
29
28 /* These are bit masks and shift counts to use to access the various 30 /* These are bit masks and shift counts to use to access the various
29 fields of an instruction. To retrieve the X field of an 31 fields of an instruction. To retrieve the X field of an
30 instruction, use the expression 32 instruction, use the expression
31 (i >> OP_SH_X) & OP_MASK_X 33 (i >> OP_SH_X) & OP_MASK_X
32 To set the same field (to j), use 34 To set the same field (to j), use
33 i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X) 35 i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X)
34 36
35 Make sure you use fields that are appropriate for the instruction, 37 Make sure you use fields that are appropriate for the instruction,
36 of course. 38 of course.
37 39
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 #define OP_OP_LDC1 0x35 205 #define OP_OP_LDC1 0x35
204 #define OP_OP_LDC2 0x36 206 #define OP_OP_LDC2 0x36
205 #define OP_OP_LDC3 0x37 /* a.k.a. ld */ 207 #define OP_OP_LDC3 0x37 /* a.k.a. ld */
206 #define OP_OP_SWC1 0x39 208 #define OP_OP_SWC1 0x39
207 #define OP_OP_SWC2 0x3a 209 #define OP_OP_SWC2 0x3a
208 #define OP_OP_SWC3 0x3b 210 #define OP_OP_SWC3 0x3b
209 #define OP_OP_SDC1 0x3d 211 #define OP_OP_SDC1 0x3d
210 #define OP_OP_SDC2 0x3e 212 #define OP_OP_SDC2 0x3e
211 #define OP_OP_SDC3 0x3f /* a.k.a. sd */ 213 #define OP_OP_SDC3 0x3f /* a.k.a. sd */
212 214
215 /* MIPS VIRT ASE */
216 #define OP_MASK_CODE10 0x3ff
217 #define OP_SH_CODE10 11
218
213 /* Values in the 'VSEL' field. */ 219 /* Values in the 'VSEL' field. */
214 #define MDMX_FMTSEL_IMM_QH 0x1d 220 #define MDMX_FMTSEL_IMM_QH 0x1d
215 #define MDMX_FMTSEL_IMM_OB 0x1e 221 #define MDMX_FMTSEL_IMM_OB 0x1e
216 #define MDMX_FMTSEL_VEC_QH 0x15 222 #define MDMX_FMTSEL_VEC_QH 0x15
217 #define MDMX_FMTSEL_VEC_OB 0x16 223 #define MDMX_FMTSEL_VEC_OB 0x16
218 224
219 /* UDI */ 225 /* UDI */
220 #define OP_SH_UDI1 6 226 #define OP_SH_UDI1 6
221 #define OP_MASK_UDI1 0x1f 227 #define OP_MASK_UDI1 0x1f
222 #define OP_SH_UDI2 6 228 #define OP_SH_UDI2 6
(...skipping 23 matching lines...) Expand all
246 #define OP_SH_RZ 0 252 #define OP_SH_RZ 0
247 #define OP_MASK_RZ 0x1f 253 #define OP_MASK_RZ 0x1f
248 #define OP_SH_FZ 0 254 #define OP_SH_FZ 0
249 #define OP_MASK_FZ 0x1f 255 #define OP_MASK_FZ 0x1f
250 256
251 /* Every MICROMIPSOP_X definition requires a corresponding OP_X 257 /* Every MICROMIPSOP_X definition requires a corresponding OP_X
252 definition, and vice versa. This simplifies various parts 258 definition, and vice versa. This simplifies various parts
253 of the operand handling in GAS. The fields below only exist 259 of the operand handling in GAS. The fields below only exist
254 in the microMIPS encoding, so define each one to have an empty 260 in the microMIPS encoding, so define each one to have an empty
255 range. */ 261 range. */
256 #define OP_MASK_CODE10 0
257 #define OP_SH_CODE10 0
258 #define OP_MASK_TRAP 0 262 #define OP_MASK_TRAP 0
259 #define OP_SH_TRAP 0 263 #define OP_SH_TRAP 0
260 #define OP_MASK_OFFSET10 0 264 #define OP_MASK_OFFSET10 0
261 #define OP_SH_OFFSET10 0 265 #define OP_SH_OFFSET10 0
262 #define OP_MASK_RS3 0 266 #define OP_MASK_RS3 0
263 #define OP_SH_RS3 0 267 #define OP_SH_RS3 0
264 #define OP_MASK_MB 0 268 #define OP_MASK_MB 0
265 #define OP_SH_MB 0 269 #define OP_SH_MB 0
266 #define OP_MASK_MC 0 270 #define OP_MASK_MC 0
267 #define OP_SH_MC 0 271 #define OP_SH_MC 0
268 #define OP_MASK_MD 0 272 #define OP_MASK_MD 0
269 #define OP_SH_MD 0 273 #define OP_SH_MD 0
270 #define OP_MASK_ME 0 274 #define OP_MASK_ME 0
271 #define OP_SH_ME 0 275 #define OP_SH_ME 0
272 #define OP_MASK_MF 0 276 #define OP_MASK_MF 0
273 #define OP_SH_MF 0 277 #define OP_SH_MF 0
274 #define OP_MASK_MG 0 278 #define OP_MASK_MG 0
275 #define OP_SH_MG 0 279 #define OP_SH_MG 0
276 #define OP_MASK_MH 0 280 #define OP_MASK_MH 0
277 #define OP_SH_MH 0 281 #define OP_SH_MH 0
278 #define OP_MASK_MI 0
279 #define OP_SH_MI 0
280 #define OP_MASK_MJ 0 282 #define OP_MASK_MJ 0
281 #define OP_SH_MJ 0 283 #define OP_SH_MJ 0
282 #define OP_MASK_ML 0 284 #define OP_MASK_ML 0
283 #define OP_SH_ML 0 285 #define OP_SH_ML 0
284 #define OP_MASK_MM 0 286 #define OP_MASK_MM 0
285 #define OP_SH_MM 0 287 #define OP_SH_MM 0
286 #define OP_MASK_MN 0 288 #define OP_MASK_MN 0
287 #define OP_SH_MN 0 289 #define OP_SH_MN 0
288 #define OP_MASK_MP 0 290 #define OP_MASK_MP 0
289 #define OP_SH_MP 0 291 #define OP_SH_MP 0
(...skipping 29 matching lines...) Expand all
319 #define OP_SH_IMMQ 0 321 #define OP_SH_IMMQ 0
320 #define OP_MASK_IMMU 0 322 #define OP_MASK_IMMU 0
321 #define OP_SH_IMMU 0 323 #define OP_SH_IMMU 0
322 #define OP_MASK_IMMW 0 324 #define OP_MASK_IMMW 0
323 #define OP_SH_IMMW 0 325 #define OP_SH_IMMW 0
324 #define OP_MASK_IMMX 0 326 #define OP_MASK_IMMX 0
325 #define OP_SH_IMMX 0 327 #define OP_SH_IMMX 0
326 #define OP_MASK_IMMY 0 328 #define OP_MASK_IMMY 0
327 #define OP_SH_IMMY 0 329 #define OP_SH_IMMY 0
328 330
331 /* Enhanced VA Scheme */
332 #define OP_SH_EVAOFFSET 7
333 #define OP_MASK_EVAOFFSET 0x1ff
334
335 /* Enumerates the various types of MIPS operand. */
336 enum mips_operand_type {
337 /* Described by mips_int_operand. */
338 OP_INT,
339
340 /* Described by mips_mapped_int_operand. */
341 OP_MAPPED_INT,
342
343 /* Described by mips_msb_operand. */
344 OP_MSB,
345
346 /* Described by mips_reg_operand. */
347 OP_REG,
348
349 /* Like OP_REG, but can be omitted if the register is the same as the
350 previous operand. */
351 OP_OPTIONAL_REG,
352
353 /* Described by mips_reg_pair_operand. */
354 OP_REG_PAIR,
355
356 /* Described by mips_pcrel_operand. */
357 OP_PCREL,
358
359 /* A performance register. The field is 5 bits in size, but the supported
360 values are much more restricted. */
361 OP_PERF_REG,
362
363 /* The final operand in a microMIPS ADDIUSP instruction. It mostly acts
364 as a normal 9-bit signed offset that is multiplied by four, but there
365 are four special cases:
366
367 -2 * 4 => -258 * 4
368 -1 * 4 => -257 * 4
369 0 * 4 => 256 * 4
370 1 * 4 => 257 * 4. */
371 OP_ADDIUSP_INT,
372
373 /* The target of a (D)CLO or (D)CLZ instruction. The operand spans two
374 5-bit register fields, both of which must be set to the destination
375 register. */
376 OP_CLO_CLZ_DEST,
377
378 /* A register list for a microMIPS LWM or SWM instruction. The operand
379 size determines whether the 16-bit or 32-bit encoding is required. */
380 OP_LWM_SWM_LIST,
381
382 /* The register list for an emulated MIPS16 ENTRY or EXIT instruction. */
383 OP_ENTRY_EXIT_LIST,
384
385 /* The register list and frame size for a MIPS16 SAVE or RESTORE
386 instruction. */
387 OP_SAVE_RESTORE_LIST,
388
389 /* A 10-bit field VVVVVNNNNN used for octobyte and quadhalf instructions:
390
391 V Meaning
392 ----- -------
393 0EEE0 8 copies of $vN[E], OB format
394 0EE01 4 copies of $vN[E], QH format
395 10110 all 8 elements of $vN, OB format
396 10101 all 4 elements of $vN, QH format
397 11110 8 copies of immediate N, OB format
398 11101 4 copies of immediate N, QH format. */
399 OP_MDMX_IMM_REG,
400
401 /* A register operand that must match the destination register. */
402 OP_REPEAT_DEST_REG,
403
404 /* A register operand that must match the previous register. */
405 OP_REPEAT_PREV_REG,
406
407 /* $pc, which has no encoding in the architectural instruction. */
408 OP_PC,
409
410 /* A 4-bit XYZW channel mask or 2-bit XYZW index; the size determines
411 which. */
412 OP_VU0_SUFFIX,
413
414 /* Like OP_VU0_SUFFIX, but used when the operand's value has already
415 been set. Any suffix used here must match the previous value. */
416 OP_VU0_MATCH_SUFFIX,
417
418 /* An index selected by an integer, e.g. [1]. */
419 OP_IMM_INDEX,
420
421 /* An index selected by a register, e.g. [$2]. */
422 OP_REG_INDEX
423 };
424
425 /* Enumerates the types of MIPS register. */
426 enum mips_reg_operand_type {
427 /* General registers $0-$31. Software names like $at can also be used. */
428 OP_REG_GP,
429
430 /* Floating-point registers $f0-$f31. */
431 OP_REG_FP,
432
433 /* Coprocessor condition code registers $cc0-$cc7. FPU condition codes
434 can also be written $fcc0-$fcc7. */
435 OP_REG_CCC,
436
437 /* FPRs used in a vector capacity. They can be written $f0-$f31
438 or $v0-$v31, although the latter form is not used for the VR5400
439 vector instructions. */
440 OP_REG_VEC,
441
442 /* DSP accumulator registers $ac0-$ac3. */
443 OP_REG_ACC,
444
445 /* Coprocessor registers $0-$31. Mnemonic names like c0_cause can
446 also be used in some contexts. */
447 OP_REG_COPRO,
448
449 /* Hardware registers $0-$31. Mnemonic names like hwr_cpunum can
450 also be used in some contexts. */
451 OP_REG_HW,
452
453 /* Floating-point registers $vf0-$vf31. */
454 OP_REG_VF,
455
456 /* Integer registers $vi0-$vi31. */
457 OP_REG_VI,
458
459 /* R5900 VU0 registers $I, $Q, $R and $ACC. */
460 OP_REG_R5900_I,
461 OP_REG_R5900_Q,
462 OP_REG_R5900_R,
463 OP_REG_R5900_ACC,
464
465 /* MSA registers $w0-$w31. */
466 OP_REG_MSA,
467
468 /* MSA control registers $0-$31. */
469 OP_REG_MSA_CTRL
470 };
471
472 /* Base class for all operands. */
473 struct mips_operand
474 {
475 /* The type of the operand. */
476 enum mips_operand_type type;
477
478 /* The operand occupies SIZE bits of the instruction, starting at LSB. */
479 unsigned short size;
480 unsigned short lsb;
481 };
482
483 /* Describes an integer operand with a regular encoding pattern. */
484 struct mips_int_operand
485 {
486 struct mips_operand root;
487
488 /* The low ROOT.SIZE bits of MAX_VAL encodes (MAX_VAL + BIAS) << SHIFT.
489 The cyclically previous field value encodes 1 << SHIFT less than that,
490 and so on. E.g.
491
492 - for { { T, 4, L }, 14, 0, 0 }, field values 0...14 encode themselves,
493 but 15 encodes -1.
494
495 - { { T, 8, L }, 127, 0, 2 } is a normal signed 8-bit operand that is
496 shifted left two places.
497
498 - { { T, 3, L }, 8, 0, 0 } is a normal unsigned 3-bit operand except
499 that 0 encodes 8.
500
501 - { { ... }, 0, 1, 3 } means that N encodes (N + 1) << 3. */
502 unsigned int max_val;
503 int bias;
504 unsigned int shift;
505
506 /* True if the operand should be printed as hex rather than decimal. */
507 bfd_boolean print_hex;
508 };
509
510 /* Uses a lookup table to describe a small integer operand. */
511 struct mips_mapped_int_operand
512 {
513 struct mips_operand root;
514
515 /* Maps each encoding value to the integer that it represents. */
516 const int *int_map;
517
518 /* True if the operand should be printed as hex rather than decimal. */
519 bfd_boolean print_hex;
520 };
521
522 /* An operand that encodes the most significant bit position of a bitfield.
523 Given a bitfield that spans bits [MSB, LSB], some operands of this type
524 encode MSB directly while others encode MSB - LSB. Each operand of this
525 type is preceded by an integer operand that specifies LSB.
526
527 The assembly form varies between instructions. For some instructions,
528 such as EXT, the operand is written as the bitfield size. For others,
529 such as EXTS, it is written in raw MSB - LSB form. */
530 struct mips_msb_operand
531 {
532 struct mips_operand root;
533
534 /* The assembly-level operand encoded by a field value of 0. */
535 int bias;
536
537 /* True if the operand encodes MSB directly, false if it encodes
538 MSB - LSB. */
539 bfd_boolean add_lsb;
540
541 /* The maximum value of MSB + 1. */
542 unsigned int opsize;
543 };
544
545 /* Describes a single register operand. */
546 struct mips_reg_operand
547 {
548 struct mips_operand root;
549
550 /* The type of register. */
551 enum mips_reg_operand_type reg_type;
552
553 /* If nonnull, REG_MAP[N] gives the register associated with encoding N,
554 otherwise the encoding is the same as the register number. */
555 const unsigned char *reg_map;
556 };
557
558 /* Describes an operand that encodes a pair of registers. */
559 struct mips_reg_pair_operand
560 {
561 struct mips_operand root;
562
563 /* The type of register. */
564 enum mips_reg_operand_type reg_type;
565
566 /* Encoding N represents REG1_MAP[N], REG2_MAP[N]. */
567 unsigned char *reg1_map;
568 unsigned char *reg2_map;
569 };
570
571 /* Describes an operand that is calculated relative to a base PC.
572 The base PC is usually the address of the following instruction,
573 but the rules for MIPS16 instructions like ADDIUPC are more complicated. */
574 struct mips_pcrel_operand
575 {
576 /* Encodes the offset. */
577 struct mips_int_operand root;
578
579 /* The low ALIGN_LOG2 bits of the base PC are cleared to give PC',
580 which is then added to the offset encoded by ROOT. */
581 unsigned int align_log2 : 8;
582
583 /* If INCLUDE_ISA_BIT, the ISA bit of the original base PC is then
584 reinstated. This is true for jumps and branches and false for
585 PC-relative data instructions. */
586 unsigned int include_isa_bit : 1;
587
588 /* If FLIP_ISA_BIT, the ISA bit of the result is inverted.
589 This is true for JALX and false otherwise. */
590 unsigned int flip_isa_bit : 1;
591 };
592
593 /* Return true if the assembly syntax allows OPERAND to be omitted. */
594
595 static inline bfd_boolean
596 mips_optional_operand_p (const struct mips_operand *operand)
597 {
598 return (operand->type == OP_OPTIONAL_REG
599 || operand->type == OP_REPEAT_PREV_REG);
600 }
601
602 /* Return a version of INSN in which the field specified by OPERAND
603 has value UVAL. */
604
605 static inline unsigned int
606 mips_insert_operand (const struct mips_operand *operand, unsigned int insn,
607 unsigned int uval)
608 {
609 unsigned int mask;
610
611 mask = (1 << operand->size) - 1;
612 insn &= ~(mask << operand->lsb);
613 insn |= (uval & mask) << operand->lsb;
614 return insn;
615 }
616
617 /* Extract OPERAND from instruction INSN. */
618
619 static inline unsigned int
620 mips_extract_operand (const struct mips_operand *operand, unsigned int insn)
621 {
622 return (insn >> operand->lsb) & ((1 << operand->size) - 1);
623 }
624
625 /* UVAL is the value encoded by OPERAND. Return it in signed form. */
626
627 static inline int
628 mips_signed_operand (const struct mips_operand *operand, unsigned int uval)
629 {
630 unsigned int sign_bit, mask;
631
632 mask = (1 << operand->size) - 1;
633 sign_bit = 1 << (operand->size - 1);
634 return ((uval + sign_bit) & mask) - sign_bit;
635 }
636
637 /* Return the integer that OPERAND encodes as UVAL. */
638
639 static inline int
640 mips_decode_int_operand (const struct mips_int_operand *operand,
641 unsigned int uval)
642 {
643 uval |= (operand->max_val - uval) & -(1 << operand->root.size);
644 uval += operand->bias;
645 uval <<= operand->shift;
646 return uval;
647 }
648
649 /* Return the maximum value that can be encoded by OPERAND. */
650
651 static inline int
652 mips_int_operand_max (const struct mips_int_operand *operand)
653 {
654 return (operand->max_val + operand->bias) << operand->shift;
655 }
656
657 /* Return the minimum value that can be encoded by OPERAND. */
658
659 static inline int
660 mips_int_operand_min (const struct mips_int_operand *operand)
661 {
662 unsigned int mask;
663
664 mask = (1 << operand->root.size) - 1;
665 return mips_int_operand_max (operand) - (mask << operand->shift);
666 }
667
668 /* Return the register that OPERAND encodes as UVAL. */
669
670 static inline int
671 mips_decode_reg_operand (const struct mips_reg_operand *operand,
672 unsigned int uval)
673 {
674 if (operand->reg_map)
675 uval = operand->reg_map[uval];
676 return uval;
677 }
678
679 /* PC-relative operand OPERAND has value UVAL and is relative to BASE_PC.
680 Return the address that it encodes. */
681
682 static inline bfd_vma
683 mips_decode_pcrel_operand (const struct mips_pcrel_operand *operand,
684 bfd_vma base_pc, unsigned int uval)
685 {
686 bfd_vma addr;
687
688 addr = base_pc & -(1 << operand->align_log2);
689 addr += mips_decode_int_operand (&operand->root, uval);
690 if (operand->include_isa_bit)
691 addr |= base_pc & 1;
692 if (operand->flip_isa_bit)
693 addr ^= 1;
694 return addr;
695 }
696
329 /* This structure holds information for a particular instruction. */ 697 /* This structure holds information for a particular instruction. */
330 698
331 struct mips_opcode 699 struct mips_opcode
332 { 700 {
333 /* The name of the instruction. */ 701 /* The name of the instruction. */
334 const char *name; 702 const char *name;
335 /* A string describing the arguments for this instruction. */ 703 /* A string describing the arguments for this instruction. */
336 const char *args; 704 const char *args;
337 /* The basic opcode for the instruction. When assembling, this 705 /* The basic opcode for the instruction. When assembling, this
338 opcode is modified by the arguments to produce the actual opcode 706 opcode is modified by the arguments to produce the actual opcode
339 that is used. If pinfo is INSN_MACRO, then this is 0. */ 707 that is used. If pinfo is INSN_MACRO, then this is 0. */
340 unsigned long match; 708 unsigned long match;
341 /* If pinfo is not INSN_MACRO, then this is a bit mask for the 709 /* If pinfo is not INSN_MACRO, then this is a bit mask for the
342 relevant portions of the opcode when disassembling. If the 710 relevant portions of the opcode when disassembling. If the
343 actual opcode anded with the match field equals the opcode field, 711 actual opcode anded with the match field equals the opcode field,
344 then we have found the correct instruction. If pinfo is 712 then we have found the correct instruction. If pinfo is
345 INSN_MACRO, then this field is the macro identifier. */ 713 INSN_MACRO, then this field is the macro identifier. */
346 unsigned long mask; 714 unsigned long mask;
347 /* For a macro, this is INSN_MACRO. Otherwise, it is a collection 715 /* For a macro, this is INSN_MACRO. Otherwise, it is a collection
348 of bits describing the instruction, notably any relevant hazard 716 of bits describing the instruction, notably any relevant hazard
349 information. */ 717 information. */
350 unsigned long pinfo; 718 unsigned long pinfo;
351 /* A collection of additional bits describing the instruction. */ 719 /* A collection of additional bits describing the instruction. */
352 unsigned long pinfo2; 720 unsigned long pinfo2;
353 /* A collection of bits describing the instruction sets of which this 721 /* A collection of bits describing the instruction sets of which this
354 instruction or macro is a member. */ 722 instruction or macro is a member. */
355 unsigned long membership; 723 unsigned long membership;
724 /* A collection of bits describing the ASE of which this instruction
725 or macro is a member. */
726 unsigned long ase;
727 /* A collection of bits describing the instruction sets of which this
728 instruction or macro is not a member. */
729 unsigned long exclusions;
356 }; 730 };
357 731
358 /* These are the characters which may appear in the args field of an 732 /* These are the characters which may appear in the args field of an
359 instruction. They appear in the order in which the fields appear 733 instruction. They appear in the order in which the fields appear
360 when the instruction is used. Commas and parentheses in the args 734 when the instruction is used. Commas and parentheses in the args
361 string are ignored when assembling, and written into the output 735 string are ignored when assembling, and written into the output
362 when disassembling. 736 when disassembling.
363 737
364 Each of these characters corresponds to a mask field defined above. 738 Each of these characters corresponds to a mask field defined above.
365 739
366 "1" 5 bit sync type (OP_*_SHAMT) 740 "1" 5 bit sync type (OP_*_STYPE)
367 "<" 5 bit shift amount (OP_*_SHAMT) 741 "<" 5 bit shift amount (OP_*_SHAMT)
368 ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT) 742 ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT)
369 "a" 26 bit target address (OP_*_TARGET) 743 "a" 26 bit target address (OP_*_TARGET)
744 "+i" likewise, but flips bit 0
370 "b" 5 bit base register (OP_*_RS) 745 "b" 5 bit base register (OP_*_RS)
371 "c" 10 bit breakpoint code (OP_*_CODE) 746 "c" 10 bit breakpoint code (OP_*_CODE)
372 "d" 5 bit destination register specifier (OP_*_RD) 747 "d" 5 bit destination register specifier (OP_*_RD)
373 "h" 5 bit prefx hint (OP_*_PREFX) 748 "h" 5 bit prefx hint (OP_*_PREFX)
374 "i" 16 bit unsigned immediate (OP_*_IMMEDIATE) 749 "i" 16 bit unsigned immediate (OP_*_IMMEDIATE)
375 "j" 16 bit signed immediate (OP_*_DELTA) 750 "j" 16 bit signed immediate (OP_*_DELTA)
376 "k" 5 bit cache opcode in target register position (OP_*_CACHE) 751 "k" 5 bit cache opcode in target register position (OP_*_CACHE)
377 Also used for immediate operands in vr5400 vector insns.
378 "o" 16 bit signed offset (OP_*_DELTA) 752 "o" 16 bit signed offset (OP_*_DELTA)
379 "p" 16 bit PC relative branch target address (OP_*_DELTA) 753 "p" 16 bit PC relative branch target address (OP_*_DELTA)
380 "q" 10 bit extra breakpoint code (OP_*_CODE2) 754 "q" 10 bit extra breakpoint code (OP_*_CODE2)
381 "r" 5 bit same register used as both source and target (OP_*_RS) 755 "r" 5 bit same register used as both source and target (OP_*_RS)
382 "s" 5 bit source register specifier (OP_*_RS) 756 "s" 5 bit source register specifier (OP_*_RS)
383 "t" 5 bit target register (OP_*_RT) 757 "t" 5 bit target register (OP_*_RT)
384 "u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE) 758 "u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE)
385 "v" 5 bit same register used as both source and destination (OP_*_RS) 759 "v" 5 bit same register used as both source and destination (OP_*_RS)
386 "w" 5 bit same register used as both target and destination (OP_*_RT) 760 "w" 5 bit same register used as both target and destination (OP_*_RT)
387 "U" 5 bit same destination register in both OP_*_RD and OP_*_RT 761 "U" 5 bit same destination register in both OP_*_RD and OP_*_RT
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "V" 5 bit same register used as floating source and destination (OP_*_FS) 800 "V" 5 bit same register used as floating source and destination (OP_*_FS)
427 "W" 5 bit same register used as floating target and destination (OP_*_FT) 801 "W" 5 bit same register used as floating target and destination (OP_*_FT)
428 802
429 Coprocessor instructions: 803 Coprocessor instructions:
430 "E" 5 bit target register (OP_*_RT) 804 "E" 5 bit target register (OP_*_RT)
431 "G" 5 bit destination register (OP_*_RD) 805 "G" 5 bit destination register (OP_*_RD)
432 "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL) 806 "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL)
433 "P" 5 bit performance-monitor register (OP_*_PERFREG) 807 "P" 5 bit performance-monitor register (OP_*_PERFREG)
434 "e" 5 bit vector register byte specifier (OP_*_VECBYTE) 808 "e" 5 bit vector register byte specifier (OP_*_VECBYTE)
435 "%" 3 bit immediate vr5400 vector alignment operand (OP_*_VECALIGN) 809 "%" 3 bit immediate vr5400 vector alignment operand (OP_*_VECALIGN)
436 see also "k" above
437 "+D" Combined destination register ("G") and sel ("H") for CP0 ops,
438 for pretty-printing in disassembly only.
439 810
440 Macro instructions: 811 Macro instructions:
441 "A" General 32 bit expression 812 "A" General 32 bit expression
442 "I" 32 bit immediate (value placed in imm_expr). 813 "I" 32 bit immediate (value placed in imm_expr).
443 "+I" 32 bit immediate (value placed in imm2_expr).
444 "F" 64 bit floating point constant in .rdata 814 "F" 64 bit floating point constant in .rdata
445 "L" 64 bit floating point constant in .lit8 815 "L" 64 bit floating point constant in .lit8
446 "f" 32 bit floating point constant 816 "f" 32 bit floating point constant
447 "l" 32 bit floating point constant in .lit4 817 "l" 32 bit floating point constant in .lit4
448 818
449 MDMX instruction operands (note that while these use the FP register 819 MDMX and VR5400 instruction operands (note that while these use the
450 fields, they accept both $fN and $vN names for the registers): 820 FP register fields, the MDMX instructions accept both $fN and $vN names
451 "O"» MDMX alignment offset (OP_*_ALN) 821 for the registers):
452 "Q"» MDMX vector/scalar/immediate source (OP_*_VSEL and OP_*_FT) 822 "O"» alignment offset (OP_*_ALN)
453 "X"» MDMX destination register (OP_*_FD) 823 "Q"» vector/scalar/immediate source (OP_*_VSEL and OP_*_FT)
454 "Y"» MDMX source register (OP_*_FS) 824 "X"» destination register (OP_*_FD)
455 "Z"» MDMX source register (OP_*_FT) 825 "Y"» source register (OP_*_FS)
826 "Z"» source register (OP_*_FT)
827
828 R5900 VU0 Macromode instructions:
829 "+5" 5 bit floating point register (FD)
830 "+6" 5 bit floating point register (FS)
831 "+7" 5 bit floating point register (FT)
832 "+8" 5 bit integer register (FD)
833 "+9" 5 bit integer register (FS)
834 "+0" 5 bit integer register (FT)
835 "+K" match an existing 4-bit channel mask starting at bit 21
836 "+L" 2-bit channel index starting at bit 21
837 "+M" 2-bit channel index starting at bit 23
838 "+N" match an existing 2-bit channel index starting at bit 0
839 "+f" 15 bit immediate for VCALLMS
840 "+g" 5 bit signed immediate for VIADDI
841 "+m" $ACC register (syntax only)
842 "+q" $Q register (syntax only)
843 "+r" $R register (syntax only)
844 "+y" $I register (syntax only)
845 "#+" "++" decorator in ($reg++) sequence
846 "#-" "--" decorator in (--$reg) sequence
456 847
457 DSP ASE usage: 848 DSP ASE usage:
458 "2" 2 bit unsigned immediate for byte align (OP_*_BP) 849 "2" 2 bit unsigned immediate for byte align (OP_*_BP)
459 "3" 3 bit unsigned immediate (OP_*_SA3) 850 "3" 3 bit unsigned immediate (OP_*_SA3)
460 "4" 4 bit unsigned immediate (OP_*_SA4) 851 "4" 4 bit unsigned immediate (OP_*_SA4)
461 "5" 8 bit unsigned immediate (OP_*_IMM8) 852 "5" 8 bit unsigned immediate (OP_*_IMM8)
462 "6" 5 bit unsigned immediate (OP_*_RS) 853 "6" 5 bit unsigned immediate (OP_*_RS)
463 "7" 2 bit dsp accumulator register (OP_*_DSPACC) 854 "7" 2 bit dsp accumulator register (OP_*_DSPACC)
464 "8" 6 bit unsigned immediate (OP_*_WRDSP) 855 "8" 6 bit unsigned immediate (OP_*_WRDSP)
465 "9" 2 bit dsp accumulator register (OP_*_DSPACC_S) 856 "9" 2 bit dsp accumulator register (OP_*_DSPACC_S)
466 "0" 6 bit signed immediate (OP_*_DSPSFT) 857 "0" 6 bit signed immediate (OP_*_DSPSFT)
467 ":" 7 bit signed immediate (OP_*_DSPSFT_7) 858 ":" 7 bit signed immediate (OP_*_DSPSFT_7)
468 "'" 6 bit unsigned immediate (OP_*_RDDSP) 859 "'" 6 bit unsigned immediate (OP_*_RDDSP)
469 "@" 10 bit signed immediate (OP_*_IMM10) 860 "@" 10 bit signed immediate (OP_*_IMM10)
470 861
471 MT ASE usage: 862 MT ASE usage:
472 "!" 1 bit usermode flag (OP_*_MT_U) 863 "!" 1 bit usermode flag (OP_*_MT_U)
473 "$" 1 bit load high flag (OP_*_MT_H) 864 "$" 1 bit load high flag (OP_*_MT_H)
474 "*" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_T) 865 "*" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_T)
475 "&" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_D) 866 "&" 2 bit dsp/smartmips accumulator register (OP_*_MTACC_D)
476 "g" 5 bit coprocessor 1 and 2 destination register (OP_*_RD) 867 "g" 5 bit coprocessor 1 and 2 destination register (OP_*_RD)
477 "+t" 5 bit coprocessor 0 destination register (OP_*_RT) 868 "+t" 5 bit coprocessor 0 destination register (OP_*_RT)
478 "+T" 5 bit coprocessor 0 destination register (OP_*_RT) - disassembly only
479 869
480 MCU ASE usage: 870 MCU ASE usage:
481 "~" 12 bit offset (OP_*_OFFSET12) 871 "~" 12 bit offset (OP_*_OFFSET12)
482 "\" 3 bit position for aset and aclr (OP_*_3BITPOS) 872 "\" 3 bit position for aset and aclr (OP_*_3BITPOS)
483 873
874 VIRT ASE usage:
875 "+J" 10-bit hypcall code (OP_*CODE10)
876
484 UDI immediates: 877 UDI immediates:
485 "+1" UDI immediate bits 6-10 878 "+1" UDI immediate bits 6-10
486 "+2" UDI immediate bits 6-15 879 "+2" UDI immediate bits 6-15
487 "+3" UDI immediate bits 6-20 880 "+3" UDI immediate bits 6-20
488 "+4" UDI immediate bits 6-25 881 "+4" UDI immediate bits 6-25
489 882
490 Octeon: 883 Octeon:
491 "+x" Bit index field of bbit. Enforces: 0 <= index < 32. 884 "+x" Bit index field of bbit. Enforces: 0 <= index < 32.
492 "+X" Bit index field of bbit aliasing bbit32. Matches if 32 <= index < 64, 885 "+X" Bit index field of bbit aliasing bbit32. Matches if 32 <= index < 64,
493 otherwise skips to next candidate. 886 otherwise skips to next candidate.
494 "+p" Position field of cins/cins32/exts/exts32. Enforces 0 <= pos < 32. 887 "+p" Position field of cins/cins32/exts/exts32. Enforces 0 <= pos < 32.
495 "+P" Position field of cins/exts aliasing cins32/exts32. Matches if 888 "+P" Position field of cins/exts aliasing cins32/exts32. Matches if
496 32 <= pos < 64, otherwise skips to next candidate. 889 32 <= pos < 64, otherwise skips to next candidate.
497 "+Q" Immediate field of seqi/snei. Enforces -512 <= imm < 512. 890 "+Q" Immediate field of seqi/snei. Enforces -512 <= imm < 512.
498 "+s" Length-minus-one field of cins/exts. Enforces: 0 <= lenm1 < 32. 891 "+s" Length-minus-one field of cins32/exts32. Requires msb position
499 "+S" Length-minus-one field of cins32/exts32 or cins/exts aliasing 892 » of the field to be <= 31.
500 » cint32/exts32. Enforces non-negative value and that 893 "+S" Length-minus-one field of cins/exts. Requires msb position
501 » pos + lenm1 < 32 or pos + lenm1 < 64 depending whether previous 894 » of the field to be <= 63.
502 » position field is "+p" or "+P".
503 895
504 Loongson-3A: 896 Loongson-3A:
505 "+a" 8-bit signed offset in bit 6 (OP_*_OFFSET_A) 897 "+a" 8-bit signed offset in bit 6 (OP_*_OFFSET_A)
506 "+b" 8-bit signed offset in bit 3 (OP_*_OFFSET_B) 898 "+b" 8-bit signed offset in bit 3 (OP_*_OFFSET_B)
507 "+c" 9-bit signed offset in bit 6 (OP_*_OFFSET_C) 899 "+c" 9-bit signed offset in bit 6 (OP_*_OFFSET_C)
508 "+z" 5-bit rz register (OP_*_RZ) 900 "+z" 5-bit rz register (OP_*_RZ)
509 "+Z" 5-bit fz register (OP_*_FZ) 901 "+Z" 5-bit fz register (OP_*_FZ)
510 902
903 Enhanced VA Scheme:
904 "+j" 9-bit signed offset in bit 7 (OP_*_EVAOFFSET)
905
906 MSA Extension:
907 "+d" 5-bit MSA register (FD)
908 "+e" 5-bit MSA register (FS)
909 "+h" 5-bit MSA register (FT)
910 "+k" 5-bit GPR at bit 6
911 "+l" 5-bit MSA control register at bit 6
912 "+n" 5-bit MSA control register at bit 11
913 "+o" 5-bit vector element index at bit 16
914 "+u" 4-bit vector element index at bit 16
915 "+v" 3-bit vector element index at bit 16
916 "+w" 2-bit vector element index at bit 16
917 "+T" (-512 .. 511) << 0 at bit 16
918 "+U" (-512 .. 511) << 1 at bit 16
919 "+V" (-512 .. 511) << 2 at bit 16
920 "+W" (-512 .. 511) << 3 at bit 16
921 "+~" 2 bit LSA/DLSA shift amount from 1 to 4 at bit 6
922 "+!" 3 bit unsigned bit position at bit 16
923 "+@" 4 bit unsigned bit position at bit 16
924 "+#" 6 bit unsigned bit position at bit 16
925 "+$" 5 bit unsigned immediate at bit 16
926 "+%" 5 bit signed immediate at bit 16
927 "+^" 10 bit signed immediate at bit 11
928 "+&" 0 vector element index
929 "+*" 5-bit register vector element index at bit 16
930 "+|" 8-bit mask at bit 16
931
511 Other: 932 Other:
512 "()" parens surrounding optional value 933 "()" parens surrounding optional value
513 "," separates operands 934 "," separates operands
514 "[]" brackets around index for vector-op scalar operand specifier (vr5400)
515 "+" Start of extension sequence. 935 "+" Start of extension sequence.
516 936
517 Characters used so far, for quick reference when adding more: 937 Characters used so far, for quick reference when adding more:
518 "1234567890" 938 "1234567890"
519 "%[]<>(),+:'@!$*&\~" 939 "%[]<>(),+:'@!#$*&\~"
520 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 940 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
521 "abcdefghijklopqrstuvwxz" 941 "abcdefghijklopqrstuvwxz"
522 942
523 Extension character sequences used so far ("+" followed by the 943 Extension character sequences used so far ("+" followed by the
524 following), for quick reference when adding more: 944 following), for quick reference when adding more:
525 "1234" 945 "1234567890"
526 "ABCDEFGHIPQSTXZ" 946 "~!@#$%^&*|"
527 "abcpstxz" 947 "ABCEFGHJKLMNPQSTUVWXZ"
948 "abcdefghijklmnopqrstuvwxyz"
528 */ 949 */
529 950
530 /* These are the bits which may be set in the pinfo field of an 951 /* These are the bits which may be set in the pinfo field of an
531 instructions, if it is not equal to INSN_MACRO. */ 952 instructions, if it is not equal to INSN_MACRO. */
532 953
533 /* Modifies the general purpose register in OP_*_RD. */ 954 /* Writes to operand number N. */
534 #define INSN_WRITE_GPR_D 0x00000001 955 #define INSN_WRITE_SHIFT 0
535 /* Modifies the general purpose register in OP_*_RT. */ 956 #define INSN_WRITE_1 0x00000001
536 #define INSN_WRITE_GPR_T 0x00000002 957 #define INSN_WRITE_2 0x00000002
958 #define INSN_WRITE_ALL 0x00000003
959 /* Reads from operand number N. */
960 #define INSN_READ_SHIFT 2
961 #define INSN_READ_1 0x00000004
962 #define INSN_READ_2 0x00000008
963 #define INSN_READ_3 0x00000010
964 #define INSN_READ_4 0x00000020
965 #define INSN_READ_ALL 0x0000003c
537 /* Modifies general purpose register 31. */ 966 /* Modifies general purpose register 31. */
538 #define INSN_WRITE_GPR_31 0x00000004 967 #define INSN_WRITE_GPR_31 0x00000040
539 /* Modifies the floating point register in OP_*_FD. */
540 #define INSN_WRITE_FPR_D 0x00000008
541 /* Modifies the floating point register in OP_*_FS. */
542 #define INSN_WRITE_FPR_S 0x00000010
543 /* Modifies the floating point register in OP_*_FT. */
544 #define INSN_WRITE_FPR_T 0x00000020
545 /* Reads the general purpose register in OP_*_RS. */
546 #define INSN_READ_GPR_S 0x00000040
547 /* Reads the general purpose register in OP_*_RT. */
548 #define INSN_READ_GPR_T 0x00000080
549 /* Reads the floating point register in OP_*_FS. */
550 #define INSN_READ_FPR_S 0x00000100
551 /* Reads the floating point register in OP_*_FT. */
552 #define INSN_READ_FPR_T 0x00000200
553 /* Reads the floating point register in OP_*_FR. */
554 #define INSN_READ_FPR_R»» 0x00000400
555 /* Modifies coprocessor condition code. */ 968 /* Modifies coprocessor condition code. */
556 #define INSN_WRITE_COND_CODE 0x00000800 969 #define INSN_WRITE_COND_CODE 0x00000080
557 /* Reads coprocessor condition code. */ 970 /* Reads coprocessor condition code. */
558 #define INSN_READ_COND_CODE 0x00001000 971 #define INSN_READ_COND_CODE 0x00000100
559 /* TLB operation. */ 972 /* TLB operation. */
560 #define INSN_TLB 0x00002000 973 #define INSN_TLB 0x00000200
561 /* Reads coprocessor register other than floating point register. */ 974 /* Reads coprocessor register other than floating point register. */
562 #define INSN_COP 0x00004000 975 #define INSN_COP 0x00000400
563 /* Instruction loads value from memory, requiring delay. */ 976 /* Instruction loads value from memory. */
564 #define INSN_LOAD_MEMORY_DELAY 0x00008000 977 #define INSN_LOAD_MEMORY» 0x00000800
565 /* Instruction loads value from coprocessor, requiring delay. */ 978 /* Instruction loads value from coprocessor, requiring delay. */
566 #define INSN_LOAD_COPROC_DELAY» 0x00010000 979 #define INSN_LOAD_COPROC_DELAY» 0x00001000
567 /* Instruction has unconditional branch delay slot. */ 980 /* Instruction has unconditional branch delay slot. */
568 #define INSN_UNCOND_BRANCH_DELAY 0x00020000 981 #define INSN_UNCOND_BRANCH_DELAY 0x00002000
569 /* Instruction has conditional branch delay slot. */ 982 /* Instruction has conditional branch delay slot. */
570 #define INSN_COND_BRANCH_DELAY 0x00040000 983 #define INSN_COND_BRANCH_DELAY 0x00004000
571 /* Conditional branch likely: if branch not taken, insn nullified. */ 984 /* Conditional branch likely: if branch not taken, insn nullified. */
572 #define INSN_COND_BRANCH_LIKELY» 0x00080000 985 #define INSN_COND_BRANCH_LIKELY» 0x00008000
573 /* Moves to coprocessor register, requiring delay. */ 986 /* Moves to coprocessor register, requiring delay. */
574 #define INSN_COPROC_MOVE_DELAY 0x00100000 987 #define INSN_COPROC_MOVE_DELAY 0x00010000
575 /* Loads coprocessor register from memory, requiring delay. */ 988 /* Loads coprocessor register from memory, requiring delay. */
576 #define INSN_COPROC_MEMORY_DELAY 0x00200000 989 #define INSN_COPROC_MEMORY_DELAY 0x00020000
577 /* Reads the HI register. */ 990 /* Reads the HI register. */
578 #define INSN_READ_HI» » 0x00400000 991 #define INSN_READ_HI» » 0x00040000
579 /* Reads the LO register. */ 992 /* Reads the LO register. */
580 #define INSN_READ_LO» » 0x00800000 993 #define INSN_READ_LO» » 0x00080000
581 /* Modifies the HI register. */ 994 /* Modifies the HI register. */
582 #define INSN_WRITE_HI» » 0x01000000 995 #define INSN_WRITE_HI» » 0x00100000
583 /* Modifies the LO register. */ 996 /* Modifies the LO register. */
584 #define INSN_WRITE_LO» » 0x02000000 997 #define INSN_WRITE_LO» » 0x00200000
585 /* Not to be placed in a branch delay slot, either architecturally 998 /* Not to be placed in a branch delay slot, either architecturally
586 or for ease of handling (such as with instructions that take a trap). */ 999 or for ease of handling (such as with instructions that take a trap). */
587 #define INSN_NO_DELAY_SLOT» 0x04000000 1000 #define INSN_NO_DELAY_SLOT» 0x00400000
588 /* Instruction stores value into memory. */ 1001 /* Instruction stores value into memory. */
589 #define INSN_STORE_MEMORY» 0x08000000 1002 #define INSN_STORE_MEMORY» 0x00800000
590 /* Instruction uses single precision floating point. */ 1003 /* Instruction uses single precision floating point. */
591 #define FP_S» » » 0x10000000 1004 #define FP_S» » » 0x01000000
592 /* Instruction uses double precision floating point. */ 1005 /* Instruction uses double precision floating point. */
593 #define FP_D» » » 0x20000000 1006 #define FP_D» » » 0x02000000
594 /* Instruction is part of the tx39's integer multiply family. */ 1007 /* Instruction is part of the tx39's integer multiply family. */
595 #define INSN_MULT 0x40000000 1008 #define INSN_MULT 0x04000000
596 /* Modifies the general purpose register in MICROMIPSOP_*_RS. */ 1009 /* Reads general purpose register 24. */
597 #define INSN_WRITE_GPR_S» 0x80000000 1010 #define INSN_READ_GPR_24 0x08000000
1011 /* Writes to general purpose register 24. */
1012 #define INSN_WRITE_GPR_24 0x10000000
1013 /* A user-defined instruction. */
1014 #define INSN_UDI 0x20000000
598 /* Instruction is actually a macro. It should be ignored by the 1015 /* Instruction is actually a macro. It should be ignored by the
599 disassembler, and requires special treatment by the assembler. */ 1016 disassembler, and requires special treatment by the assembler. */
600 #define INSN_MACRO 0xffffffff 1017 #define INSN_MACRO 0xffffffff
601 1018
602 /* These are the bits which may be set in the pinfo2 field of an 1019 /* These are the bits which may be set in the pinfo2 field of an
603 instruction. */ 1020 instruction. */
604 1021
605 /* Instruction is a simple alias (I.E. "move" for daddu/addu/or) */ 1022 /* Instruction is a simple alias (I.E. "move" for daddu/addu/or) */
606 #define INSN2_ALIAS 0x00000001 1023 #define INSN2_ALIAS 0x00000001
607 /* Instruction reads MDMX accumulator. */ 1024 /* Instruction reads MDMX accumulator. */
608 #define INSN2_READ_MDMX_ACC 0x00000002 1025 #define INSN2_READ_MDMX_ACC 0x00000002
609 /* Instruction writes MDMX accumulator. */ 1026 /* Instruction writes MDMX accumulator. */
610 #define INSN2_WRITE_MDMX_ACC 0x00000004 1027 #define INSN2_WRITE_MDMX_ACC 0x00000004
611 /* Macro uses single-precision floating-point instructions. This should 1028 /* Macro uses single-precision floating-point instructions. This should
612 only be set for macros. For instructions, FP_S in pinfo carries the 1029 only be set for macros. For instructions, FP_S in pinfo carries the
613 same information. */ 1030 same information. */
614 #define INSN2_M_FP_S 0x00000008 1031 #define INSN2_M_FP_S 0x00000008
615 /* Macro uses double-precision floating-point instructions. This should 1032 /* Macro uses double-precision floating-point instructions. This should
616 only be set for macros. For instructions, FP_D in pinfo carries the 1033 only be set for macros. For instructions, FP_D in pinfo carries the
617 same information. */ 1034 same information. */
618 #define INSN2_M_FP_D 0x00000010 1035 #define INSN2_M_FP_D 0x00000010
619 /* Modifies the general purpose register in OP_*_RZ. */
620 #define INSN2_WRITE_GPR_Z 0x00000020
621 /* Modifies the floating point register in OP_*_FZ. */
622 #define INSN2_WRITE_FPR_Z 0x00000040
623 /* Reads the general purpose register in OP_*_RZ. */
624 #define INSN2_READ_GPR_Z 0x00000080
625 /* Reads the floating point register in OP_*_FZ. */
626 #define INSN2_READ_FPR_Z 0x00000100
627 /* Reads the general purpose register in OP_*_RD. */
628 #define INSN2_READ_GPR_D 0x00000200
629
630
631 /* Instruction has a branch delay slot that requires a 16-bit instruction. */ 1036 /* Instruction has a branch delay slot that requires a 16-bit instruction. */
632 #define INSN2_BRANCH_DELAY_16BIT 0x00000400 1037 #define INSN2_BRANCH_DELAY_16BIT 0x00000020
633 /* Instruction has a branch delay slot that requires a 32-bit instruction. */ 1038 /* Instruction has a branch delay slot that requires a 32-bit instruction. */
634 #define INSN2_BRANCH_DELAY_32BIT 0x00000800 1039 #define INSN2_BRANCH_DELAY_32BIT 0x00000040
635 /* Reads the floating point register in MICROMIPSOP_*_FD. */ 1040 /* Writes to the stack pointer ($29). */
636 #define INSN2_READ_FPR_D» 0x00001000 1041 #define INSN2_WRITE_SP» » 0x00000080
637 /* Modifies the general purpose register in MICROMIPSOP_*_MB. */ 1042 /* Reads from the stack pointer ($29). */
638 #define INSN2_WRITE_GPR_MB» 0x00002000 1043 #define INSN2_READ_SP» » 0x00000100
639 /* Reads the general purpose register in MICROMIPSOP_*_MC. */
640 #define INSN2_READ_GPR_MC» 0x00004000
641 /* Reads/writes the general purpose register in MICROMIPSOP_*_MD. */
642 #define INSN2_MOD_GPR_MD» 0x00008000
643 /* Reads the general purpose register in MICROMIPSOP_*_ME. */
644 #define INSN2_READ_GPR_ME» 0x00010000
645 /* Reads/writes the general purpose register in MICROMIPSOP_*_MF. */
646 #define INSN2_MOD_GPR_MF» 0x00020000
647 /* Reads the general purpose register in MICROMIPSOP_*_MG. */
648 #define INSN2_READ_GPR_MG» 0x00040000
649 /* Reads the general purpose register in MICROMIPSOP_*_MJ. */
650 #define INSN2_READ_GPR_MJ» 0x00080000
651 /* Modifies the general purpose register in MICROMIPSOP_*_MJ. */
652 #define INSN2_WRITE_GPR_MJ» 0x00100000
653 /* Reads the general purpose register in MICROMIPSOP_*_MP. */
654 #define INSN2_READ_GPR_MP» 0x00200000
655 /* Modifies the general purpose register in MICROMIPSOP_*_MP. */
656 #define INSN2_WRITE_GPR_MP» 0x00400000
657 /* Reads the general purpose register in MICROMIPSOP_*_MQ. */
658 #define INSN2_READ_GPR_MQ» 0x00800000
659 /* Reads/Writes the stack pointer ($29). */
660 #define INSN2_MOD_SP» » 0x01000000
661 /* Reads the RA ($31) register. */ 1044 /* Reads the RA ($31) register. */
662 #define INSN2_READ_GPR_31» 0x02000000 1045 #define INSN2_READ_GPR_31» 0x00000200
663 /* Reads the global pointer ($28). */
664 #define INSN2_READ_GP» » 0x04000000
665 /* Reads the program counter ($pc). */ 1046 /* Reads the program counter ($pc). */
666 #define INSN2_READ_PC» » 0x08000000 1047 #define INSN2_READ_PC» » 0x00000400
667 /* Is an unconditional branch insn. */ 1048 /* Is an unconditional branch insn. */
668 #define INSN2_UNCOND_BRANCH» 0x10000000 1049 #define INSN2_UNCOND_BRANCH» 0x00000800
669 /* Is a conditional branch insn. */ 1050 /* Is a conditional branch insn. */
670 #define INSN2_COND_BRANCH» 0x20000000 1051 #define INSN2_COND_BRANCH» 0x00001000
671 /* Modifies the general purpose registers in MICROMIPSOP_*_MH/I. */ 1052 /* Reads from $16. This is true of the MIPS16 0x6500 nop. */
672 #define INSN2_WRITE_GPR_MHI» 0x40000000 1053 #define INSN2_READ_GPR_16 0x00002000
673 /* Reads the general purpose registers in MICROMIPSOP_*_MM/N. */ 1054 /* Has an "\.x?y?z?w?" suffix based on mips_vu0_channel_mask. */
674 #define INSN2_READ_GPR_MMN» 0x80000000 1055 #define INSN2_VU0_CHANNEL_SUFFIX 0x00004000
675 1056
676 /* Masks used to mark instructions to indicate which MIPS ISA level 1057 /* Masks used to mark instructions to indicate which MIPS ISA level
677 they were introduced in. INSN_ISA_MASK masks an enumeration that 1058 they were introduced in. INSN_ISA_MASK masks an enumeration that
678 specifies the base ISA level(s). The remainder of a 32-bit 1059 specifies the base ISA level(s). The remainder of a 32-bit
679 word constructed using these macros is a bitmask of the remaining 1060 word constructed using these macros is a bitmask of the remaining
680 INSN_* values below. */ 1061 INSN_* values below. */
681 1062
682 #define INSN_ISA_MASK 0x0000000ful 1063 #define INSN_ISA_MASK 0x0000000ful
683 1064
684 /* We cannot start at zero due to ISA_UNKNOWN below. */ 1065 /* We cannot start at zero due to ISA_UNKNOWN below. */
(...skipping 28 matching lines...) Expand all
713 { 0x0001, 0x0003, 0x0607, 0x1e0f, 0x3e1f, 0x0a23, 0x3e63, 0x3ebf, 0x3fff }; 1094 { 0x0001, 0x0003, 0x0607, 0x1e0f, 0x3e1f, 0x0a23, 0x3e63, 0x3ebf, 0x3fff };
714 1095
715 /* Masks used for Chip specific instructions. */ 1096 /* Masks used for Chip specific instructions. */
716 #define INSN_CHIP_MASK 0xc3ff0f20 1097 #define INSN_CHIP_MASK 0xc3ff0f20
717 1098
718 /* Cavium Networks Octeon instructions. */ 1099 /* Cavium Networks Octeon instructions. */
719 #define INSN_OCTEON 0x00000800 1100 #define INSN_OCTEON 0x00000800
720 #define INSN_OCTEONP 0x00000200 1101 #define INSN_OCTEONP 0x00000200
721 #define INSN_OCTEON2 0x00000100 1102 #define INSN_OCTEON2 0x00000100
722 1103
723 /* Masks used for MIPS-defined ASEs. */ 1104 /* MIPS R5900 instruction */
724 #define INSN_ASE_MASK» » 0x3c00f010 1105 #define INSN_5900 0x00004000
725
726 /* DSP ASE */
727 #define INSN_DSP 0x00001000
728 #define INSN_DSP64 0x00002000
729
730 /* 0x00004000 is unused. */
731
732 /* MIPS-3D ASE */
733 #define INSN_MIPS3D 0x00008000
734 1106
735 /* MIPS R4650 instruction. */ 1107 /* MIPS R4650 instruction. */
736 #define INSN_4650 0x00010000 1108 #define INSN_4650 0x00010000
737 /* LSI R4010 instruction. */ 1109 /* LSI R4010 instruction. */
738 #define INSN_4010 0x00020000 1110 #define INSN_4010 0x00020000
739 /* NEC VR4100 instruction. */ 1111 /* NEC VR4100 instruction. */
740 #define INSN_4100 0x00040000 1112 #define INSN_4100 0x00040000
741 /* Toshiba R3900 instruction. */ 1113 /* Toshiba R3900 instruction. */
742 #define INSN_3900 0x00080000 1114 #define INSN_3900 0x00080000
743 /* MIPS R10000 instruction. */ 1115 /* MIPS R10000 instruction. */
744 #define INSN_10000 0x00100000 1116 #define INSN_10000 0x00100000
745 /* Broadcom SB-1 instruction. */ 1117 /* Broadcom SB-1 instruction. */
746 #define INSN_SB1 0x00200000 1118 #define INSN_SB1 0x00200000
747 /* NEC VR4111/VR4181 instruction. */ 1119 /* NEC VR4111/VR4181 instruction. */
748 #define INSN_4111 0x00400000 1120 #define INSN_4111 0x00400000
749 /* NEC VR4120 instruction. */ 1121 /* NEC VR4120 instruction. */
750 #define INSN_4120 0x00800000 1122 #define INSN_4120 0x00800000
751 /* NEC VR5400 instruction. */ 1123 /* NEC VR5400 instruction. */
752 #define INSN_5400 0x01000000 1124 #define INSN_5400 0x01000000
753 /* NEC VR5500 instruction. */ 1125 /* NEC VR5500 instruction. */
754 #define INSN_5500 0x02000000 1126 #define INSN_5500 0x02000000
755 1127
756 /* MDMX ASE */
757 #define INSN_MDMX 0x04000000
758 /* MT ASE */
759 #define INSN_MT 0x08000000
760 /* SmartMIPS ASE */
761 #define INSN_SMARTMIPS 0x10000000
762 /* DSP R2 ASE */
763 #define INSN_DSPR2 0x20000000
764 /* ST Microelectronics Loongson 2E. */ 1128 /* ST Microelectronics Loongson 2E. */
765 #define INSN_LOONGSON_2E 0x40000000 1129 #define INSN_LOONGSON_2E 0x40000000
766 /* ST Microelectronics Loongson 2F. */ 1130 /* ST Microelectronics Loongson 2F. */
767 #define INSN_LOONGSON_2F 0x80000000 1131 #define INSN_LOONGSON_2F 0x80000000
768 /* Loongson 3A. */ 1132 /* Loongson 3A. */
769 #define INSN_LOONGSON_3A 0x00000400 1133 #define INSN_LOONGSON_3A 0x00000400
770 /* RMI Xlr instruction */ 1134 /* RMI Xlr instruction */
771 #define INSN_XLR » 0x00000020 1135 #define INSN_XLR 0x00000020
772 1136
1137 /* DSP ASE */
1138 #define ASE_DSP 0x00000001
1139 #define ASE_DSP64 0x00000002
1140 /* DSP R2 ASE */
1141 #define ASE_DSPR2 0x00000004
1142 /* Enhanced VA Scheme */
1143 #define ASE_EVA 0x00000008
773 /* MCU (MicroController) ASE */ 1144 /* MCU (MicroController) ASE */
774 #define INSN_MCU» » 0x00000010 1145 #define ASE_MCU»» » 0x00000010
1146 /* MDMX ASE */
1147 #define ASE_MDMX» » 0x00000020
1148 /* MIPS-3D ASE */
1149 #define ASE_MIPS3D» » 0x00000040
1150 /* MT ASE */
1151 #define ASE_MT» » » 0x00000080
1152 /* SmartMIPS ASE */
1153 #define ASE_SMARTMIPS» » 0x00000100
1154 /* Virtualization ASE */
1155 #define ASE_VIRT» » 0x00000200
1156 #define ASE_VIRT64» » 0x00000400
1157 /* MSA Extension */
1158 #define ASE_MSA»» » 0x00000800
1159 #define ASE_MSA64» » 0x00001000
775 1160
776 /* MIPS ISA defines, use instead of hardcoding ISA level. */ 1161 /* MIPS ISA defines, use instead of hardcoding ISA level. */
777 1162
778 #define ISA_UNKNOWN 0 /* Gas internal use. */ 1163 #define ISA_UNKNOWN 0 /* Gas internal use. */
779 #define ISA_MIPS1 INSN_ISA1 1164 #define ISA_MIPS1 INSN_ISA1
780 #define ISA_MIPS2 INSN_ISA2 1165 #define ISA_MIPS2 INSN_ISA2
781 #define ISA_MIPS3 INSN_ISA3 1166 #define ISA_MIPS3 INSN_ISA3
782 #define ISA_MIPS4 INSN_ISA4 1167 #define ISA_MIPS4 INSN_ISA4
783 #define ISA_MIPS5 INSN_ISA5 1168 #define ISA_MIPS5 INSN_ISA5
784 1169
(...skipping 14 matching lines...) Expand all
799 #define CPU_VR4100 4100 1184 #define CPU_VR4100 4100
800 #define CPU_R4111 4111 1185 #define CPU_R4111 4111
801 #define CPU_VR4120 4120 1186 #define CPU_VR4120 4120
802 #define CPU_R4300 4300 1187 #define CPU_R4300 4300
803 #define CPU_R4400 4400 1188 #define CPU_R4400 4400
804 #define CPU_R4600 4600 1189 #define CPU_R4600 4600
805 #define CPU_R4650 4650 1190 #define CPU_R4650 4650
806 #define CPU_R5000 5000 1191 #define CPU_R5000 5000
807 #define CPU_VR5400 5400 1192 #define CPU_VR5400 5400
808 #define CPU_VR5500 5500 1193 #define CPU_VR5500 5500
1194 #define CPU_R5900 5900
809 #define CPU_R6000 6000 1195 #define CPU_R6000 6000
810 #define CPU_RM7000 7000 1196 #define CPU_RM7000 7000
811 #define CPU_R8000 8000 1197 #define CPU_R8000 8000
812 #define CPU_RM9000 9000 1198 #define CPU_RM9000 9000
813 #define CPU_R10000 10000 1199 #define CPU_R10000 10000
814 #define CPU_R12000 12000 1200 #define CPU_R12000 12000
815 #define CPU_R14000 14000 1201 #define CPU_R14000 14000
816 #define CPU_R16000 16000 1202 #define CPU_R16000 16000
817 #define CPU_MIPS16 16 1203 #define CPU_MIPS16 16
818 #define CPU_MIPS32 32 1204 #define CPU_MIPS32 32
819 #define CPU_MIPS32R2 33 1205 #define CPU_MIPS32R2 33
820 #define CPU_MIPS5 5 1206 #define CPU_MIPS5 5
821 #define CPU_MIPS64 64 1207 #define CPU_MIPS64 64
822 #define CPU_MIPS64R2 65 1208 #define CPU_MIPS64R2 65
823 #define CPU_SB1 12310201 /* octal 'SB', 01. */ 1209 #define CPU_SB1 12310201 /* octal 'SB', 01. */
824 #define CPU_LOONGSON_2E 3001 1210 #define CPU_LOONGSON_2E 3001
825 #define CPU_LOONGSON_2F 3002 1211 #define CPU_LOONGSON_2F 3002
826 #define CPU_LOONGSON_3A 3003 1212 #define CPU_LOONGSON_3A 3003
827 #define CPU_OCTEON 6501 1213 #define CPU_OCTEON 6501
828 #define CPU_OCTEONP 6601 1214 #define CPU_OCTEONP 6601
829 #define CPU_OCTEON2 6502 1215 #define CPU_OCTEON2 6502
830 #define CPU_XLR 887682 /* decimal 'XLR' */ 1216 #define CPU_XLR 887682 /* decimal 'XLR' */
831 1217
1218 /* Return true if the given CPU is included in INSN_* mask MASK. */
1219
1220 static inline bfd_boolean
1221 cpu_is_member (int cpu, unsigned int mask)
1222 {
1223 switch (cpu)
1224 {
1225 case CPU_R4650:
1226 case CPU_RM7000:
1227 case CPU_RM9000:
1228 return (mask & INSN_4650) != 0;
1229
1230 case CPU_R4010:
1231 return (mask & INSN_4010) != 0;
1232
1233 case CPU_VR4100:
1234 return (mask & INSN_4100) != 0;
1235
1236 case CPU_R3900:
1237 return (mask & INSN_3900) != 0;
1238
1239 case CPU_R10000:
1240 case CPU_R12000:
1241 case CPU_R14000:
1242 case CPU_R16000:
1243 return (mask & INSN_10000) != 0;
1244
1245 case CPU_SB1:
1246 return (mask & INSN_SB1) != 0;
1247
1248 case CPU_R4111:
1249 return (mask & INSN_4111) != 0;
1250
1251 case CPU_VR4120:
1252 return (mask & INSN_4120) != 0;
1253
1254 case CPU_VR5400:
1255 return (mask & INSN_5400) != 0;
1256
1257 case CPU_VR5500:
1258 return (mask & INSN_5500) != 0;
1259
1260 case CPU_R5900:
1261 return (mask & INSN_5900) != 0;
1262
1263 case CPU_LOONGSON_2E:
1264 return (mask & INSN_LOONGSON_2E) != 0;
1265
1266 case CPU_LOONGSON_2F:
1267 return (mask & INSN_LOONGSON_2F) != 0;
1268
1269 case CPU_LOONGSON_3A:
1270 return (mask & INSN_LOONGSON_3A) != 0;
1271
1272 case CPU_OCTEON:
1273 return (mask & INSN_OCTEON) != 0;
1274
1275 case CPU_OCTEONP:
1276 return (mask & INSN_OCTEONP) != 0;
1277
1278 case CPU_OCTEON2:
1279 return (mask & INSN_OCTEON2) != 0;
1280
1281 case CPU_XLR:
1282 return (mask & INSN_XLR) != 0;
1283
1284 default:
1285 return FALSE;
1286 }
1287 }
1288
832 /* Test for membership in an ISA including chip specific ISAs. INSN 1289 /* Test for membership in an ISA including chip specific ISAs. INSN
833 is pointer to an element of the opcode table; ISA is the specified 1290 is pointer to an element of the opcode table; ISA is the specified
834 ISA/ASE bitmask to test against; and CPU is the CPU specific ISA to 1291 ISA/ASE bitmask to test against; and CPU is the CPU specific ISA to
835 test, or zero if no CPU specific ISA test is desired. */ 1292 test, or zero if no CPU specific ISA test is desired. Return true
1293 if instruction INSN is available to the given ISA and CPU. */
836 1294
837 #define OPCODE_IS_MEMBER(insn, isa, cpu)» » » » \ 1295 static inline bfd_boolean
838 (((isa & INSN_ISA_MASK) != 0 \ 1296 opcode_is_member (const struct mips_opcode *insn, int isa, int ase, int cpu)
839 && ((insn)->membership & INSN_ISA_MASK) != 0 \ 1297 {
840 && ((mips_isa_table [(isa & INSN_ISA_MASK) - 1] >> \ 1298 if (!cpu_is_member (cpu, insn->exclusions))
841 (((insn)->membership & INSN_ISA_MASK) - 1)) & 1) != 0) \ 1299 {
842 || ((isa & ~INSN_ISA_MASK) \ 1300 /* Test for ISA level compatibility. */
843 & ((insn)->membership & ~INSN_ISA_MASK)) != 0 \ 1301 if ((isa & INSN_ISA_MASK) != 0
844 || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0)» \ 1302 » && (insn->membership & INSN_ISA_MASK) != 0
845 || (cpu == CPU_RM7000 && ((insn)->membership & INSN_4650) != 0)» \ 1303 » && ((mips_isa_table[(isa & INSN_ISA_MASK) - 1]
846 || (cpu == CPU_RM9000 && ((insn)->membership & INSN_4650) != 0)» \ 1304 » >> ((insn->membership & INSN_ISA_MASK) - 1)) & 1) != 0)
847 || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0)» \ 1305 » return TRUE;
848 || (cpu == CPU_VR4100 && ((insn)->membership & INSN_4100) != 0)» \ 1306
849 || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0)» \ 1307 /* Test for ASE compatibility. */
850 || ((cpu == CPU_R10000 || cpu == CPU_R12000 || cpu == CPU_R14000» \ 1308 if ((ase & insn->ase) != 0)
851 » || cpu == CPU_R16000)»» » » » » \ 1309 » return TRUE;
852 » && ((insn)->membership & INSN_10000) != 0)» » » \ 1310
853 || (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0)» \ 1311 /* Test for processor-specific extensions. */
854 || (cpu == CPU_R4111 && ((insn)->membership & INSN_4111) != 0)» \ 1312 if (cpu_is_member (cpu, insn->membership))
855 || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0)» \ 1313 » return TRUE;
856 || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0)» \ 1314 }
857 || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0)» \ 1315 return FALSE;
858 || (cpu == CPU_LOONGSON_2E \ 1316 }
859 && ((insn)->membership & INSN_LOONGSON_2E) != 0) \
860 || (cpu == CPU_LOONGSON_2F \
861 && ((insn)->membership & INSN_LOONGSON_2F) != 0) \
862 || (cpu == CPU_LOONGSON_3A \
863 && ((insn)->membership & INSN_LOONGSON_3A) != 0) \
864 || (cpu == CPU_OCTEON» » » » » » \
865 » && ((insn)->membership & INSN_OCTEON) != 0)» » » \
866 || (cpu == CPU_OCTEONP» » » » » » \
867 » && ((insn)->membership & INSN_OCTEONP) != 0)» » » \
868 || (cpu == CPU_OCTEON2» » » » » » \
869 » && ((insn)->membership & INSN_OCTEON2) != 0)» » » \
870 || (cpu == CPU_XLR && ((insn)->membership & INSN_XLR) != 0) \
871 || 0)» /* Please keep this term for easier source merging. */
872 1317
873 /* This is a list of macro expanded instructions. 1318 /* This is a list of macro expanded instructions.
874 1319
875 _I appended means immediate 1320 _I appended means immediate
876 _A appended means address 1321 _A appended means target address of a jump
877 _AB appended means address with base register 1322 _AB appended means address with (possibly zero) base register
878 _D appended means 64 bit floating point constant 1323 _D appended means 64 bit floating point constant
879 _S appended means 32 bit floating point constant. */ 1324 _S appended means 32 bit floating point constant. */
880 1325
881 enum 1326 enum
882 { 1327 {
883 M_ABS, 1328 M_ABS,
884 M_ACLR_AB, 1329 M_ACLR_AB,
885 M_ACLR_OB,
886 M_ADD_I, 1330 M_ADD_I,
887 M_ADDU_I, 1331 M_ADDU_I,
888 M_AND_I, 1332 M_AND_I,
889 M_ASET_AB, 1333 M_ASET_AB,
890 M_ASET_OB,
891 M_BALIGN, 1334 M_BALIGN,
892 M_BC1FL, 1335 M_BC1FL,
893 M_BC1TL, 1336 M_BC1TL,
894 M_BC2FL, 1337 M_BC2FL,
895 M_BC2TL, 1338 M_BC2TL,
896 M_BEQ, 1339 M_BEQ,
897 M_BEQ_I, 1340 M_BEQ_I,
898 M_BEQL, 1341 M_BEQL,
899 M_BEQL_I, 1342 M_BEQL_I,
900 M_BGE, 1343 M_BGE,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 M_BLTU_I, 1380 M_BLTU_I,
938 M_BLTUL_I, 1381 M_BLTUL_I,
939 M_BLTZ, 1382 M_BLTZ,
940 M_BLTZL, 1383 M_BLTZL,
941 M_BLTZALL, 1384 M_BLTZALL,
942 M_BNE, 1385 M_BNE,
943 M_BNEL, 1386 M_BNEL,
944 M_BNE_I, 1387 M_BNE_I,
945 M_BNEL_I, 1388 M_BNEL_I,
946 M_CACHE_AB, 1389 M_CACHE_AB,
947 M_CACHE_OB, 1390 M_CACHEE_AB,
948 M_DABS, 1391 M_DABS,
949 M_DADD_I, 1392 M_DADD_I,
950 M_DADDU_I, 1393 M_DADDU_I,
951 M_DDIV_3, 1394 M_DDIV_3,
952 M_DDIV_3I, 1395 M_DDIV_3I,
953 M_DDIVU_3, 1396 M_DDIVU_3,
954 M_DDIVU_3I, 1397 M_DDIVU_3I,
955 M_DEXT,
956 M_DINS,
957 M_DIV_3, 1398 M_DIV_3,
958 M_DIV_3I, 1399 M_DIV_3I,
959 M_DIVU_3, 1400 M_DIVU_3,
960 M_DIVU_3I, 1401 M_DIVU_3I,
961 M_DLA_AB, 1402 M_DLA_AB,
962 M_DLCA_AB, 1403 M_DLCA_AB,
963 M_DLI, 1404 M_DLI,
964 M_DMUL, 1405 M_DMUL,
965 M_DMUL_I, 1406 M_DMUL_I,
966 M_DMULO, 1407 M_DMULO,
967 M_DMULO_I, 1408 M_DMULO_I,
968 M_DMULOU, 1409 M_DMULOU,
969 M_DMULOU_I, 1410 M_DMULOU_I,
970 M_DREM_3, 1411 M_DREM_3,
971 M_DREM_3I, 1412 M_DREM_3I,
972 M_DREMU_3, 1413 M_DREMU_3,
973 M_DREMU_3I, 1414 M_DREMU_3I,
974 M_DSUB_I, 1415 M_DSUB_I,
975 M_DSUBU_I, 1416 M_DSUBU_I,
976 M_DSUBU_I_2, 1417 M_DSUBU_I_2,
977 M_J_A, 1418 M_J_A,
978 M_JAL_1, 1419 M_JAL_1,
979 M_JAL_2, 1420 M_JAL_2,
980 M_JAL_A, 1421 M_JAL_A,
981 M_JALS_1, 1422 M_JALS_1,
982 M_JALS_2, 1423 M_JALS_2,
983 M_JALS_A, 1424 M_JALS_A,
984 M_L_DOB, 1425 M_JRADDIUSP,
1426 M_JRC,
985 M_L_DAB, 1427 M_L_DAB,
986 M_LA_AB, 1428 M_LA_AB,
987 M_LB_A,
988 M_LB_AB, 1429 M_LB_AB,
989 M_LBU_A, 1430 M_LBE_AB,
990 M_LBU_AB, 1431 M_LBU_AB,
1432 M_LBUE_AB,
991 M_LCA_AB, 1433 M_LCA_AB,
992 M_LD_A,
993 M_LD_OB,
994 M_LD_AB, 1434 M_LD_AB,
995 M_LDC1_AB, 1435 M_LDC1_AB,
996 M_LDC2_AB, 1436 M_LDC2_AB,
997 M_LDC2_OB, 1437 M_LQC2_AB,
998 M_LDC3_AB, 1438 M_LDC3_AB,
999 M_LDL_AB, 1439 M_LDL_AB,
1000 M_LDL_OB,
1001 M_LDM_AB, 1440 M_LDM_AB,
1002 M_LDM_OB,
1003 M_LDP_AB, 1441 M_LDP_AB,
1004 M_LDP_OB,
1005 M_LDR_AB, 1442 M_LDR_AB,
1006 M_LDR_OB,
1007 M_LH_A,
1008 M_LH_AB, 1443 M_LH_AB,
1009 M_LHU_A, 1444 M_LHE_AB,
1010 M_LHU_AB, 1445 M_LHU_AB,
1446 M_LHUE_AB,
1011 M_LI, 1447 M_LI,
1012 M_LI_D, 1448 M_LI_D,
1013 M_LI_DD, 1449 M_LI_DD,
1014 M_LI_S, 1450 M_LI_S,
1015 M_LI_SS, 1451 M_LI_SS,
1016 M_LL_AB, 1452 M_LL_AB,
1017 M_LL_OB,
1018 M_LLD_AB, 1453 M_LLD_AB,
1019 M_LLD_OB, 1454 M_LLE_AB,
1020 M_LS_A, 1455 M_LQ_AB,
1021 M_LW_A,
1022 M_LW_AB, 1456 M_LW_AB,
1023 M_LWC0_A, 1457 M_LWE_AB,
1024 M_LWC0_AB, 1458 M_LWC0_AB,
1025 M_LWC1_A,
1026 M_LWC1_AB, 1459 M_LWC1_AB,
1027 M_LWC2_A,
1028 M_LWC2_AB, 1460 M_LWC2_AB,
1029 M_LWC2_OB,
1030 M_LWC3_A,
1031 M_LWC3_AB, 1461 M_LWC3_AB,
1032 M_LWL_A,
1033 M_LWL_AB, 1462 M_LWL_AB,
1034 M_LWL_OB, 1463 M_LWLE_AB,
1035 M_LWM_AB, 1464 M_LWM_AB,
1036 M_LWM_OB,
1037 M_LWP_AB, 1465 M_LWP_AB,
1038 M_LWP_OB,
1039 M_LWR_A,
1040 M_LWR_AB, 1466 M_LWR_AB,
1041 M_LWR_OB, 1467 M_LWRE_AB,
1042 M_LWU_AB, 1468 M_LWU_AB,
1043 M_LWU_OB,
1044 M_MSGSND, 1469 M_MSGSND,
1045 M_MSGLD, 1470 M_MSGLD,
1046 M_MSGLD_T, 1471 M_MSGLD_T,
1047 M_MSGWAIT, 1472 M_MSGWAIT,
1048 M_MSGWAIT_T, 1473 M_MSGWAIT_T,
1049 M_MOVE, 1474 M_MOVE,
1475 M_MOVEP,
1050 M_MUL, 1476 M_MUL,
1051 M_MUL_I, 1477 M_MUL_I,
1052 M_MULO, 1478 M_MULO,
1053 M_MULO_I, 1479 M_MULO_I,
1054 M_MULOU, 1480 M_MULOU,
1055 M_MULOU_I, 1481 M_MULOU_I,
1056 M_NOR_I, 1482 M_NOR_I,
1057 M_OR_I, 1483 M_OR_I,
1058 M_PREF_AB, 1484 M_PREF_AB,
1059 M_PREF_OB, 1485 M_PREFE_AB,
1060 M_REM_3, 1486 M_REM_3,
1061 M_REM_3I, 1487 M_REM_3I,
1062 M_REMU_3, 1488 M_REMU_3,
1063 M_REMU_3I, 1489 M_REMU_3I,
1064 M_DROL, 1490 M_DROL,
1065 M_ROL, 1491 M_ROL,
1066 M_DROL_I, 1492 M_DROL_I,
1067 M_ROL_I, 1493 M_ROL_I,
1068 M_DROR, 1494 M_DROR,
1069 M_ROR, 1495 M_ROR,
1070 M_DROR_I, 1496 M_DROR_I,
1071 M_ROR_I, 1497 M_ROR_I,
1072 M_S_DA, 1498 M_S_DA,
1073 M_S_DOB,
1074 M_S_DAB, 1499 M_S_DAB,
1075 M_S_S, 1500 M_S_S,
1076 M_SAA_AB, 1501 M_SAA_AB,
1077 M_SAA_OB,
1078 M_SAAD_AB, 1502 M_SAAD_AB,
1079 M_SAAD_OB,
1080 M_SC_AB, 1503 M_SC_AB,
1081 M_SC_OB,
1082 M_SCD_AB, 1504 M_SCD_AB,
1083 M_SCD_OB, 1505 M_SCE_AB,
1084 M_SD_A,
1085 M_SD_OB,
1086 M_SD_AB, 1506 M_SD_AB,
1087 M_SDC1_AB, 1507 M_SDC1_AB,
1088 M_SDC2_AB, 1508 M_SDC2_AB,
1089 M_SDC2_OB, 1509 M_SQC2_AB,
1090 M_SDC3_AB, 1510 M_SDC3_AB,
1091 M_SDL_AB, 1511 M_SDL_AB,
1092 M_SDL_OB,
1093 M_SDM_AB, 1512 M_SDM_AB,
1094 M_SDM_OB,
1095 M_SDP_AB, 1513 M_SDP_AB,
1096 M_SDP_OB,
1097 M_SDR_AB, 1514 M_SDR_AB,
1098 M_SDR_OB,
1099 M_SEQ, 1515 M_SEQ,
1100 M_SEQ_I, 1516 M_SEQ_I,
1101 M_SGE, 1517 M_SGE,
1102 M_SGE_I, 1518 M_SGE_I,
1103 M_SGEU, 1519 M_SGEU,
1104 M_SGEU_I, 1520 M_SGEU_I,
1105 M_SGT, 1521 M_SGT,
1106 M_SGT_I, 1522 M_SGT_I,
1107 M_SGTU, 1523 M_SGTU,
1108 M_SGTU_I, 1524 M_SGTU_I,
1109 M_SLE, 1525 M_SLE,
1110 M_SLE_I, 1526 M_SLE_I,
1111 M_SLEU, 1527 M_SLEU,
1112 M_SLEU_I, 1528 M_SLEU_I,
1113 M_SLT_I, 1529 M_SLT_I,
1114 M_SLTU_I, 1530 M_SLTU_I,
1115 M_SNE, 1531 M_SNE,
1116 M_SNE_I, 1532 M_SNE_I,
1117 M_SB_A,
1118 M_SB_AB, 1533 M_SB_AB,
1119 M_SH_A, 1534 M_SBE_AB,
1120 M_SH_AB, 1535 M_SH_AB,
1121 M_SW_A, 1536 M_SHE_AB,
1537 M_SQ_AB,
1122 M_SW_AB, 1538 M_SW_AB,
1123 M_SWC0_A, 1539 M_SWE_AB,
1124 M_SWC0_AB, 1540 M_SWC0_AB,
1125 M_SWC1_A,
1126 M_SWC1_AB, 1541 M_SWC1_AB,
1127 M_SWC2_A,
1128 M_SWC2_AB, 1542 M_SWC2_AB,
1129 M_SWC2_OB,
1130 M_SWC3_A,
1131 M_SWC3_AB, 1543 M_SWC3_AB,
1132 M_SWL_A,
1133 M_SWL_AB, 1544 M_SWL_AB,
1134 M_SWL_OB, 1545 M_SWLE_AB,
1135 M_SWM_AB, 1546 M_SWM_AB,
1136 M_SWM_OB,
1137 M_SWP_AB, 1547 M_SWP_AB,
1138 M_SWP_OB,
1139 M_SWR_A,
1140 M_SWR_AB, 1548 M_SWR_AB,
1141 M_SWR_OB, 1549 M_SWRE_AB,
1142 M_SUB_I, 1550 M_SUB_I,
1143 M_SUBU_I, 1551 M_SUBU_I,
1144 M_SUBU_I_2, 1552 M_SUBU_I_2,
1145 M_TEQ_I, 1553 M_TEQ_I,
1146 M_TGE_I, 1554 M_TGE_I,
1147 M_TGEU_I, 1555 M_TGEU_I,
1148 M_TLT_I, 1556 M_TLT_I,
1149 M_TLTU_I, 1557 M_TLTU_I,
1150 M_TNE_I, 1558 M_TNE_I,
1151 M_TRUNCWD, 1559 M_TRUNCWD,
1152 M_TRUNCWS, 1560 M_TRUNCWS,
1153 M_ULD, 1561 M_ULD_AB,
1154 M_ULD_A, 1562 M_ULH_AB,
1155 M_ULH, 1563 M_ULHU_AB,
1156 M_ULH_A, 1564 M_ULW_AB,
1157 M_ULHU, 1565 M_USH_AB,
1158 M_ULHU_A, 1566 M_USW_AB,
1159 M_ULW, 1567 M_USD_AB,
1160 M_ULW_A,
1161 M_USH,
1162 M_USH_A,
1163 M_USW,
1164 M_USW_A,
1165 M_USD,
1166 M_USD_A,
1167 M_XOR_I, 1568 M_XOR_I,
1168 M_COP0, 1569 M_COP0,
1169 M_COP1, 1570 M_COP1,
1170 M_COP2, 1571 M_COP2,
1171 M_COP3, 1572 M_COP3,
1172 M_NUM_MACROS 1573 M_NUM_MACROS
1173 }; 1574 };
1174 1575
1175 1576
1176 /* The order of overloaded instructions matters. Label arguments and 1577 /* The order of overloaded instructions matters. Label arguments and
1177 register arguments look the same. Instructions that can have either 1578 register arguments look the same. Instructions that can have either
1178 for arguments must apear in the correct order in this table for the 1579 for arguments must apear in the correct order in this table for the
1179 assembler to pick the right one. In other words, entries with 1580 assembler to pick the right one. In other words, entries with
1180 immediate operands must apear after the same instruction with 1581 immediate operands must apear after the same instruction with
1181 registers. 1582 registers.
1182 1583
1183 Many instructions are short hand for other instructions (i.e., The 1584 Many instructions are short hand for other instructions (i.e., The
1184 jal <register> instruction is short for jalr <register>). */ 1585 jal <register> instruction is short for jalr <register>). */
1185 1586
1587 extern const struct mips_operand mips_vu0_channel_mask;
1588 extern const struct mips_operand *decode_mips_operand (const char *);
1186 extern const struct mips_opcode mips_builtin_opcodes[]; 1589 extern const struct mips_opcode mips_builtin_opcodes[];
1187 extern const int bfd_mips_num_builtin_opcodes; 1590 extern const int bfd_mips_num_builtin_opcodes;
1188 extern struct mips_opcode *mips_opcodes; 1591 extern struct mips_opcode *mips_opcodes;
1189 extern int bfd_mips_num_opcodes; 1592 extern int bfd_mips_num_opcodes;
1190 #define NUMOPCODES bfd_mips_num_opcodes 1593 #define NUMOPCODES bfd_mips_num_opcodes
1191 1594
1192 1595
1193 1596
1194 /* The rest of this file adds definitions for the mips16 TinyRISC 1597 /* The rest of this file adds definitions for the mips16 TinyRISC
1195 processor. */ 1598 processor. */
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 "y" 3 bit register (MIPS16OP_*_RY) 1661 "y" 3 bit register (MIPS16OP_*_RY)
1259 "x" 3 bit register (MIPS16OP_*_RX) 1662 "x" 3 bit register (MIPS16OP_*_RX)
1260 "z" 3 bit register (MIPS16OP_*_RZ) 1663 "z" 3 bit register (MIPS16OP_*_RZ)
1261 "Z" 3 bit register (MIPS16OP_*_MOVE32Z) 1664 "Z" 3 bit register (MIPS16OP_*_MOVE32Z)
1262 "v" 3 bit same register as source and destination (MIPS16OP_*_RX) 1665 "v" 3 bit same register as source and destination (MIPS16OP_*_RX)
1263 "w" 3 bit same register as source and destination (MIPS16OP_*_RY) 1666 "w" 3 bit same register as source and destination (MIPS16OP_*_RY)
1264 "0" zero register ($0) 1667 "0" zero register ($0)
1265 "S" stack pointer ($sp or $29) 1668 "S" stack pointer ($sp or $29)
1266 "P" program counter 1669 "P" program counter
1267 "R" return address register ($ra or $31) 1670 "R" return address register ($ra or $31)

error: old chunk mismatch

OLDNEW
« no previous file with comments | « include/opcode/metag.h ('k') | include/opcode/moxie.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698