diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2013-07-07 09:50:43 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2013-07-07 09:50:43 +0000 |
commit | 27c5c572c911ec2f77bab953586870919db15a29 (patch) | |
tree | 3707c6f2cb9bb03b201d4ad70e28086b9830726b /opcodes | |
parent | e76ff5abe375e1e7535f7827db01bce70bc9710d (diff) | |
download | gdb-27c5c572c911ec2f77bab953586870919db15a29.zip gdb-27c5c572c911ec2f77bab953586870919db15a29.tar.gz gdb-27c5c572c911ec2f77bab953586870919db15a29.tar.bz2 |
include/opcode/
* mips.h: Document "+i".
opcodes/
* mips-opc.c (mips_builtin_opcodes): Use "+i" rather than "a" for
"jalx".
* mips16-opc.c (mips16_opcodes): Likewise.
* micromips-opc.c (micromips_opcodes): Likewise.
* mips-dis.c (print_insn_args, print_mips16_insn_arg)
(print_insn_mips16): Handle "+i".
(print_insn_micromips): Likewise. Conditionally preserve the
ISA bit for "a" but not for "+i".
gas/
* config/tc-mips.c (validate_mips_insn, validate_micromips_insn):
(mips_ip, mips16_ip): Handle "+i".
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 11 | ||||
-rw-r--r-- | opcodes/micromips-opc.c | 2 | ||||
-rw-r--r-- | opcodes/mips-dis.c | 39 | ||||
-rw-r--r-- | opcodes/mips-opc.c | 2 | ||||
-rw-r--r-- | opcodes/mips16-opc.c | 2 |
5 files changed, 36 insertions, 20 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8b10771..68b263f 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,16 @@ 2013-07-07 Richard Sandiford <rdsandiford@googlemail.com> + * mips-opc.c (mips_builtin_opcodes): Use "+i" rather than "a" for + "jalx". + * mips16-opc.c (mips16_opcodes): Likewise. + * micromips-opc.c (micromips_opcodes): Likewise. + * mips-dis.c (print_insn_args, print_mips16_insn_arg) + (print_insn_mips16): Handle "+i". + (print_insn_micromips): Likewise. Conditionally preserve the + ISA bit for "a" but not for "+i". + +2013-07-07 Richard Sandiford <rdsandiford@googlemail.com> + * micromips-opc.c (WR_mhi): Rename to.. (WR_mh): ...this. (micromips_opcodes): Update "movep" entry accordingly. Replace diff --git a/opcodes/micromips-opc.c b/opcodes/micromips-opc.c index 9a9a32c..6a72396 100644 --- a/opcodes/micromips-opc.c +++ b/opcodes/micromips-opc.c @@ -587,7 +587,7 @@ const struct mips_opcode micromips_opcodes[] = {"jals", "s", 0, (int) M_JALS_1, INSN_MACRO, 0, I1 }, {"jals", "a", 0, (int) M_JALS_A, INSN_MACRO, 0, I1 }, {"jals", "a", 0x74000000, 0xfc000000, UBD|WR_31, BD16, I1 }, -{"jalx", "a", 0xf0000000, 0xfc000000, UBD|WR_31, BD32, I1 }, +{"jalx", "+i", 0xf0000000, 0xfc000000, UBD|WR_31, BD32, I1 }, {"la", "t,A(b)", 0, (int) M_LA_AB, INSN_MACRO, 0, I1 }, {"lb", "t,o(b)", 0x1c000000, 0xfc000000, RD_b|WR_t, 0, I1 }, {"lb", "t,A(b)", 0, (int) M_LB_AB, INSN_MACRO, 0, I1 }, diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c index 4d89220..9ef7247 100644 --- a/opcodes/mips-dis.c +++ b/opcodes/mips-dis.c @@ -1105,6 +1105,15 @@ print_insn_args (const char *d, infprintf (is, "%s", mips_fpr_names[GET_OP (l, FZ)]); break; + case 'i': /* JALX destination */ + info->target = (((pc + 4) & ~(bfd_vma) 0x0fffffff) + | (GET_OP (l, TARGET) << 2)); + /* For gdb disassembler, force odd address on jalx. */ + if (info->flavour == bfd_target_unknown_flavour) + info->target |= 1; + (*info->print_address_func) (info->target, info); + break; + case 'j': /* 9-bit signed offset in bit 7. */ infprintf (is, "%d", GET_OP_S (l, EVAOFFSET)); break; @@ -1229,10 +1238,6 @@ print_insn_args (const char *d, case 'a': info->target = (((pc + 4) & ~(bfd_vma) 0x0fffffff) | (GET_OP (l, TARGET) << 2)); - /* For gdb disassembler, force odd address on jalx. */ - if (info->flavour == bfd_target_unknown_flavour - && strcmp (opp->name, "jalx") == 0) - info->target |= 1; (*info->print_address_func) (info->target, info); break; @@ -1874,13 +1879,12 @@ print_mips16_insn_arg (char type, break; case 'a': + case 'i': { - int jalx = l & 0x400; - if (! use_extend) extend = 0; l = ((l & 0x1f) << 23) | ((l & 0x3e0) << 13) | (extend << 2); - if (!jalx && info->flavour == bfd_target_unknown_flavour) + if (type == 'a' && info->flavour == bfd_target_unknown_flavour) /* For gdb disassembler, maintain odd address. */ l |= 1; } @@ -2147,7 +2151,7 @@ print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info) { const char *s; - if (strchr (op->args, 'a') != NULL) + if (op->args[0] == 'a' || op->args[0] == 'i') { if (use_extend) { @@ -2422,15 +2426,10 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info) break; case 'a': - if (strcmp (op->name, "jalx") == 0) - info->target = (((memaddr + 4) & ~(bfd_vma) 0x0fffffff) - | (GET_OP (insn, TARGET) << 2)); - else - info->target = (((memaddr + 4) & ~(bfd_vma) 0x07ffffff) - | (GET_OP (insn, TARGET) << 1)); - /* For gdb disassembler, force odd address on jalx. */ - if (info->flavour == bfd_target_unknown_flavour - && strcmp (op->name, "jalx") == 0) + info->target = (((memaddr + 4) & ~(bfd_vma) 0x07ffffff) + | (GET_OP (insn, TARGET) << 1)); + /* For gdb disassembler, maintain odd address. */ + if (info->flavour == bfd_target_unknown_flavour) info->target |= 1; (*info->print_address_func) (info->target, info); break; @@ -2658,6 +2657,12 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info) infprintf (is, "0x%x", msbd + 1); break; + case 'i': + info->target = (((memaddr + 4) & ~(bfd_vma) 0x0fffffff) + | (GET_OP (insn, TARGET) << 2)); + (*info->print_address_func) (info->target, info); + break; + case 'j': /* 9-bit signed offset in bit 0. */ delta = GET_OP_S (insn, EVAOFFSET); infprintf (is, "%d", delta); diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c index 72f5842..6d709ee 100644 --- a/opcodes/mips-opc.c +++ b/opcodes/mips-opc.c @@ -852,7 +852,7 @@ const struct mips_opcode mips_builtin_opcodes[] = assembler, but will never match user input (because the line above will match first). */ {"jal", "a", 0x0c000000, 0xfc000000, UBD|WR_31, 0, I1 }, -{"jalx", "a", 0x74000000, 0xfc000000, UBD|WR_31, 0, I1 }, +{"jalx", "+i", 0x74000000, 0xfc000000, UBD|WR_31, 0, I1 }, {"la", "t,A(b)", 0, (int) M_LA_AB, INSN_MACRO, 0, I1 }, {"laa", "d,(b),t", 0x7000049f, 0xfc0007ff, LDD|SM|WR_d|RD_t|RD_b, 0, IOCT2 }, {"laad", "d,(b),t", 0x700004df, 0xfc0007ff, LDD|SM|WR_d|RD_t|RD_b, 0, IOCT2 }, diff --git a/opcodes/mips16-opc.c b/opcodes/mips16-opc.c index 01cbcde..d90c7f3 100644 --- a/opcodes/mips16-opc.c +++ b/opcodes/mips16-opc.c @@ -167,7 +167,7 @@ const struct mips_opcode mips16_opcodes[] = {"jal", "x", 0xe840, 0xf8ff, UBD|WR_31|RD_x, 0, I1 }, {"jal", "R,x", 0xe840, 0xf8ff, UBD|WR_31|RD_x, 0, I1 }, {"jal", "a", 0x1800, 0xfc00, UBD|WR_31, 0, I1 }, -{"jalx", "a", 0x1c00, 0xfc00, UBD|WR_31, 0, I1 }, +{"jalx", "i", 0x1c00, 0xfc00, UBD|WR_31, 0, I1 }, {"jr", "x", 0xe800, 0xf8ff, UBD|RD_x, 0, I1 }, {"jr", "R", 0xe820, 0xffff, UBD|RD_31, 0, I1 }, {"j", "x", 0xe800, 0xf8ff, UBD|RD_x, 0, I1 }, |