mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 10:00:51 +00:00
sh-dsp REPEAT support:
opcodes:
* sh-opc.h (sh_nibble_type): Remove DISP_8 and DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
(sh_arg_type): Add A_PC.
(sh_table): Update entries using immediates. Add repeat.
* sh-dis.c (print_insn_shx): Remove DISP_8 and DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
gas:
* config/tc-sh.c (immediate): Delete.
(sh_operand_info): Add immediate member.
(parse_reg): Use A_PC for pc.
(parse_exp): Add second argument 'op'. All callers changed.
(parse_at): Expect pc to be coded as A_PC.
Use immediate field in *op.
(insert): Add fourth argument 'op'. All callers changed.
(build_relax): Add second argument 'op'. All callers changed.
(insert_loop_bounds): New function.
(build_Mytes): Remove DISP_4.
Split IMM_[48]{,BY[24]} into IMM[01]_[48]{,BY[24]}. Add REPEAT.
(assemble_ppi): Use immediate field in *operand.
(sh_force_relocation): Handle BFD_RELOC_SH_LOOP_{START,END}.
(md_apply_fix): Likewise.
(tc_gen_reloc): Likewise. Check for a pcrel BFD_RELOC_SH_LABEL.
include/coff:
* sh.h (R_SH_LOOP_START, R_SH_LOOP_END): Define.
include/elf:
* sh.h (R_SH_LOOP_START, R_SH_LOOP_END): New RELOC_NUMBERs.
bfd:
* reloc.c (_bfd_relocate_contents): Add BFD_RELOC_SH_LOOP_START and
BFD_RELOC_SH_LOOP_END.
* elf32-sh.c (sh_elf_howto_tab): Change special_func to
sh_elf_ignore_reloc for all entries that sh_elf_reloc used to ignore.
Add entries for R_SH_LOOP_START and R_SH_LOOP_END.
(sh_elf_reloc_loop): New function.
(sh_elf_reloc): No need to test for always-to-be-ignored relocs
any more.
(sh_rel): Add entries for BFD_RELOC_SH_LOOP_{START,END}.
(sh_elf_relocate_section): Handle BFD_RELOC_SH_LOOP_{START,END}.
* bfd-in2.h, libbfd.h: Regenerate.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Disassemble SH instructions.
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -402,16 +402,20 @@ print_insn_shx (memaddr, info)
|
||||
imm |= ~0xfff;
|
||||
imm = imm * 2 + 4;
|
||||
goto ok;
|
||||
case IMM_4:
|
||||
case IMM0_4:
|
||||
case IMM1_4:
|
||||
imm = nibs[3];
|
||||
goto ok;
|
||||
case IMM_4BY2:
|
||||
case IMM0_4BY2:
|
||||
case IMM1_4BY2:
|
||||
imm = nibs[3] <<1;
|
||||
goto ok;
|
||||
case IMM_4BY4:
|
||||
case IMM0_4BY4:
|
||||
case IMM1_4BY4:
|
||||
imm = nibs[3] <<2;
|
||||
goto ok;
|
||||
case IMM_8:
|
||||
case IMM0_8:
|
||||
case IMM1_8:
|
||||
imm = (nibs[2] << 4) | nibs[3];
|
||||
goto ok;
|
||||
case PCRELIMM_8BY2:
|
||||
@@ -422,18 +426,14 @@ print_insn_shx (memaddr, info)
|
||||
imm = ((nibs[2] << 4) | nibs[3]) <<2;
|
||||
relmask = ~ (bfd_vma) 3;
|
||||
goto ok;
|
||||
case IMM_8BY2:
|
||||
case IMM0_8BY2:
|
||||
case IMM1_8BY2:
|
||||
imm = ((nibs[2] << 4) | nibs[3]) <<1;
|
||||
goto ok;
|
||||
case IMM_8BY4:
|
||||
case IMM0_8BY4:
|
||||
case IMM1_8BY4:
|
||||
imm = ((nibs[2] << 4) | nibs[3]) <<2;
|
||||
goto ok;
|
||||
case DISP_8:
|
||||
imm = (nibs[2] << 4) | (nibs[3]);
|
||||
goto ok;
|
||||
case DISP_4:
|
||||
imm = nibs[3];
|
||||
goto ok;
|
||||
case REG_N:
|
||||
rn = nibs[n];
|
||||
break;
|
||||
@@ -456,6 +456,7 @@ print_insn_shx (memaddr, info)
|
||||
rn |= (rn & 2) << 1;
|
||||
break;
|
||||
case PPI:
|
||||
case REPEAT:
|
||||
goto fail;
|
||||
default:
|
||||
abort();
|
||||
|
||||
Reference in New Issue
Block a user