diff options
author | DJ Delorie <dj@redhat.com> | 2005-10-27 23:54:17 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2005-10-27 23:54:17 +0000 |
commit | c6552317c1a647069ce947335e8adae600c60c69 (patch) | |
tree | aeb0c5665d557c80baff12e16cca423fcea76c33 /cpu/m32c.opc | |
parent | 53dfbcc78f1d68abc39fda3660f544e931aa2237 (diff) | |
download | gdb-c6552317c1a647069ce947335e8adae600c60c69.zip gdb-c6552317c1a647069ce947335e8adae600c60c69.tar.gz gdb-c6552317c1a647069ce947335e8adae600c60c69.tar.bz2 |
* m32c.cpu (Imm-8-s4n, Imm-12-s4n): New.
(arith-jnz16-imm4-dst-defn, arith-jnz32-imm4-dst-defn,
arith-jnz-imm4-dst-mach, arith-jnz-imm4-dst): Keep track of which
imm operand is needed.
(adjnz, sbjnz): Pass the right operands.
(unary-insn-defn, unary16-defn, unary32-defn, unary-insn-mach,
unary-insn): Add -g variants for opcodes that need to support :G.
(not.BW:G, push.BW:G): Call it.
(stzx16-imm8-imm8-dsp8sb, stzx16-imm8-imm8-dsp8fb,
stzx16-imm8-imm8-abs16): Fix operand typos.
* m32c.opc (m32c_asm_hash): Support bnCND.
(parse_signed4n, print_signed4n): New.
* m32c-asm.c: Regenerate.
* m32c-desc.c: Regenerate.
* m32c-desc.h: Regenerate.
* m32c-dis.c: Regenerate.
* m32c-ibld.c: Regenerate.
* m32c-opc.c: Regenerate.
* m32c-opc.h: Regenerate.
Diffstat (limited to 'cpu/m32c.opc')
-rw-r--r-- | cpu/m32c.opc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/cpu/m32c.opc b/cpu/m32c.opc index ef0ac3b..226f8d0 100644 --- a/cpu/m32c.opc +++ b/cpu/m32c.opc @@ -69,6 +69,10 @@ m32c_asm_hash (const char *mnem) if (mnem[0] == 's' && mnem[1] == 'c') return 's'; + /* Don't hash bmCND */ + if (mnem[0] == 'b' && mnem[1] == 'm') + return 'b'; + for (h = 0; *mnem && *mnem != ' ' && *mnem != ':'; ++mnem) h += *mnem; return h % CGEN_ASM_HASH_SIZE; @@ -218,6 +222,31 @@ parse_signed4 (CGEN_CPU_DESC cd, const char **strp, } static const char * +parse_signed4n (CGEN_CPU_DESC cd, const char **strp, + int opindex, signed long *valuep) +{ + const char *errmsg = 0; + signed long value; + long have_zero = 0; + + if (strncmp (*strp, "0x0", 3) == 0 + || (**strp == '0' && *(*strp + 1) != 'x')) + have_zero = 1; + + PARSE_SIGNED; + + if (value < -7 || value > 8) + return _("Immediate is out of range -7 to 8"); + + /* If this field may require a relocation then use larger dsp16. */ + if (! have_zero && value == 0) + return _("Immediate is out of range -7 to 8"); + + *valuep = -value; + return 0; +} + +static const char * parse_signed8 (CGEN_CPU_DESC cd, const char **strp, int opindex, signed long *valuep) { @@ -1092,3 +1121,16 @@ print_push_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, { print_regset (cd, dis_info, value, attrs, pc, length, PUSH); } + +static void +print_signed4n (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, + void * dis_info, + signed long value, + unsigned int attrs ATTRIBUTE_UNUSED, + bfd_vma pc ATTRIBUTE_UNUSED, + int length ATTRIBUTE_UNUSED) +{ + disassemble_info *info = dis_info; + + (*info->fprintf_func) (info->stream, "%ld", -value); +} |