diff options
author | Alan Modra <amodra@gmail.com> | 2007-09-04 04:10:21 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2007-09-04 04:10:21 +0000 |
commit | 7bc3e93c1b29c13c6e04dd57e50c77028dc61817 (patch) | |
tree | 5913ee88b9341dd78de7cf6dc86707a130270b79 /gas | |
parent | b427ea91a5c6216f92434ccb204e9f09cf3448ac (diff) | |
download | gdb-7bc3e93c1b29c13c6e04dd57e50c77028dc61817.zip gdb-7bc3e93c1b29c13c6e04dd57e50c77028dc61817.tar.gz gdb-7bc3e93c1b29c13c6e04dd57e50c77028dc61817.tar.bz2 |
* config/tc-spu.c (struct spu_insn): Delete "flag". Add "reloc".
(md_assemble): Update init of insn. Use insn.reloc instead of
calculating from flag.
(get_imm): Set reloc rather than flag.
(calcop): Formatting.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-spu.c | 24 |
2 files changed, 18 insertions, 14 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 271643f..6fb2893 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2007-09-04 Alan Modra <amodra@bigpond.net.au> + + * config/tc-spu.c (struct spu_insn): Delete "flag". Add "reloc". + (md_assemble): Update init of insn. Use insn.reloc instead of + calculating from flag. + (get_imm): Set reloc rather than flag. + (calcop): Formatting. + 2007-08-29 Daniel Jacobowitz <dan@codesourcery.com> * dwarf2dbg.c (dwarf2_directive_loc): Emit duplicate .loc directives. diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c index 9fc8356..f50f716 100644 --- a/gas/config/tc-spu.c +++ b/gas/config/tc-spu.c @@ -44,7 +44,7 @@ struct spu_insn unsigned int opcode; expressionS exp[MAX_RELOCS]; int reloc_arg[MAX_RELOCS]; - int flag[MAX_RELOCS]; + bfd_reloc_code_real_type reloc[MAX_RELOCS]; enum spu_insns tag; }; @@ -303,7 +303,7 @@ md_assemble (char *op) insn.exp[i].X_add_number = 0; insn.exp[i].X_op = O_illegal; insn.reloc_arg[i] = -1; - insn.flag[i] = 0; + insn.reloc[i] = BFD_RELOC_NONE; } insn.opcode = format->opcode; insn.tag = (enum spu_insns) (format - spu_opcodes); @@ -352,17 +352,13 @@ md_assemble (char *op) if (insn.reloc_arg[i] >= 0) { fixS *fixP; - bfd_reloc_code_real_type reloc = arg_encode[insn.reloc_arg[i]].reloc; + bfd_reloc_code_real_type reloc = insn.reloc[i]; int pcrel = 0; - if (reloc == BFD_RELOC_SPU_PCREL9a + if (reloc == BFD_RELOC_SPU_PCREL9a || reloc == BFD_RELOC_SPU_PCREL9b - || reloc == BFD_RELOC_SPU_PCREL16) + || reloc == BFD_RELOC_SPU_PCREL16) pcrel = 1; - if (insn.flag[i] == 1) - reloc = BFD_RELOC_SPU_HI16; - else if (insn.flag[i] == 2) - reloc = BFD_RELOC_SPU_LO16; fixP = fix_new_exp (frag_now, thisfrag - frag_now->fr_literal, 4, @@ -394,7 +390,7 @@ calcop (struct spu_opcode *format, const char *param, struct spu_insn *insn) if (arg < A_P) param = get_reg (param, insn, arg, 1); else if (arg > A_P) - param = get_imm (param, insn, arg); + param = get_imm (param, insn, arg); else if (arg == A_P) { paren++; @@ -688,16 +684,16 @@ get_imm (const char *param, struct spu_insn *insn, int arg) insn->opcode |= (((val >> arg_encode[arg].rshift) & ((1 << arg_encode[arg].size) - 1)) << arg_encode[arg].pos); - insn->reloc_arg[reloc_i] = -1; - insn->flag[reloc_i] = 0; } else { insn->reloc_arg[reloc_i] = arg; if (high) - insn->flag[reloc_i] = 1; + insn->reloc[reloc_i] = BFD_RELOC_SPU_HI16; else if (low) - insn->flag[reloc_i] = 2; + insn->reloc[reloc_i] = BFD_RELOC_SPU_LO16; + else + insn->reloc[reloc_i] = arg_encode[arg].reloc; } return param; |