From e3960b961029c8a5e0f46142a5734c78a5be8ff2 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Sat, 5 Feb 1994 08:04:45 +0000 Subject: [PATCH] * hppa-dis.c (print_insn_hppa): Do not emit a space after 'F' or 'I' operands if the next format specifier is 'M' (fcmp condition completer). --- opcodes/ChangeLog | 8 +++++- opcodes/hppa-dis.c | 63 ++++++++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8a1cc0a20c8..ca0bc2bb944 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,4 +1,10 @@ -Fri Feb 4 23:38:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) +Sat Feb 5 00:04:02 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * hppa-dis.c (print_insn_hppa): Do not emit a space after 'F' + or 'I' operands if the next format specifier is 'M' (fcmp + condition completer). + +Feb 4 23:38:03 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * ppc-opc.c (powerpc_operands): New operand type MBE to handle a single number giving a bitmask for the MB and ME fields of an M diff --git a/opcodes/hppa-dis.c b/opcodes/hppa-dis.c index c159e689193..57273a3c3b4 100644 --- a/opcodes/hppa-dis.c +++ b/opcodes/hppa-dis.c @@ -29,7 +29,7 @@ static const char *const reg_names[] = {"flags", "r1", "rp", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "arg3", "arg2", "arg1", "arg0", "dp", "ret0", "ret1", - "sp", "r31"} + "sp", "r31"}; /* Floating point register names, indexed by the numbers which appear in the opcodes. */ @@ -356,7 +356,6 @@ print_insn_hppa (memaddr, info) disassemble_info *info; { unsigned int insn, i, op; - FILE *stream = info->stream; { int status = @@ -378,7 +377,7 @@ print_insn_hppa (memaddr, info) (*info->fprintf_func) (info->stream, "%s", opcode->name); - if (!strchr ("cCY~nZFIMad", opcode->args[0])) + if (!strchr ("cfCY~nNZFIMadu|", opcode->args[0])) (*info->fprintf_func) (info->stream, " "); for (s = opcode->args; *s != '\0'; ++s) { @@ -436,7 +435,8 @@ print_insn_hppa (memaddr, info) fput_const (extract_5_load (insn), info); break; case 's': - fprintf_filtered (stream, "sr%d", GET_FIELD (insn, 16, 17)); + (*info->fprintf_func) (info->stream, + "sr%d", GET_FIELD (insn, 16, 17)); break; case 'S': (*info->fprintf_func) (info->stream, "sr%d", extract_3 (insn)); @@ -489,6 +489,7 @@ print_insn_hppa (memaddr, info) (*info->fprintf_func) (info->stream, "%s ", unit_cond_names[GET_COND (insn)]); break; + case '|': case '>': case '~': (*info->fprintf_func) @@ -527,20 +528,29 @@ print_insn_hppa (memaddr, info) else (*info->fprintf_func) (info->stream, " "); break; + case 'N': + if ((insn & 0x20) && s[1]) + (*info->fprintf_func) (info->stream, ",n "); + else if (insn & 0x20) + (*info->fprintf_func) (info->stream, ",n"); + else if (s[1]) + (*info->fprintf_func) (info->stream, " "); + break; case 'w': (*info->print_address_func) (memaddr + 8 + extract_12 (insn), info); break; case 'W': - /* don't interpret an address if it's an external branch - instruction. */ - op = GET_FIELD (insn, 0, 5); - if (op != 0x38 /* be */ && op != 0x39 /* ble */) - (*info->print_address_func) ((memaddr + 8 - + extract_17 (insn)), - info); - else - fput_const (extract_17 (insn), info); + /* 17 bit PC-relative branch. */ + (*info->print_address_func) ((memaddr + 8 + + extract_17 (insn)), + info); + break; + case 'z': + /* 17 bit displacement. This is an offset from a register + so it gets disasssembled as just a number, not any sort + of address. */ + fput_const (extract_17 (insn), info); break; case 'p': (*info->fprintf_func) (info->stream, "%d", @@ -589,17 +599,18 @@ print_insn_hppa (memaddr, info) GET_FIELD (insn, 27, 31)), info); break; case 'u': - (*info->fprintf_func) (info->stream, "%d", GET_FIELD (insn, 23, 25)); + (*info->fprintf_func) (info->stream, ",%d", GET_FIELD (insn, 23, 25)); break; case 'F': - /* if no destination completer, need a space here */ - if (GET_FIELD (insn, 21, 22) == 1) + /* if no destination completer and not before a completer + for fcmp, need a space here */ + if (GET_FIELD (insn, 21, 22) == 1 || s[1] == 'M') fputs_filtered (float_format_names[GET_FIELD (insn, 19, 20)], info); else (*info->fprintf_func) (info->stream, "%s ", - float_format_names[GET_FIELD - (insn, 19, 20)]); + float_format_names[GET_FIELD + (insn, 19, 20)]); break; case 'G': (*info->fprintf_func) (info->stream, "%s ", @@ -611,14 +622,15 @@ print_insn_hppa (memaddr, info) (insn, 26, 26)], info); break; case 'I': - /* if no destination completer, need a space here */ - if (GET_FIELD (insn, 21, 22) == 1) + /* if no destination completer and not before a completer + for fcmp, need a space here */ + if (GET_FIELD (insn, 21, 22) == 1 || s[1] == 'M') fputs_filtered (float_format_names[GET_FIELD (insn, 20, 20)], info); else - fprintf_filtered (stream, "%s ", - float_format_names[GET_FIELD - (insn, 20, 20)]); + (*info->fprintf_func) (info->stream, "%s ", + float_format_names[GET_FIELD + (insn, 20, 20)]); break; case 'J': if (GET_FIELD (insn, 24, 24)) @@ -634,8 +646,9 @@ print_insn_hppa (memaddr, info) fput_fp_reg (GET_FIELD (insn, 11, 15), info); break; case 'M': - fputs_filtered (float_comp_names[GET_FIELD (insn, 27, 31)], - info); + (*info->fprintf_func) (info->stream, "%s ", + float_comp_names[GET_FIELD + (insn, 27, 31)]); break; default: (*info->fprintf_func) (info->stream, "%c", *s); -- 2.30.2