aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-m32c.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-28 14:06:57 +0000
committerAlan Modra <amodra@gmail.com>2010-06-28 14:06:57 +0000
commit87975d2a60adf249212c1c031abb4dd0dbb800ac (patch)
tree2722bdca23be6f36fabde10b3e20fddfecc763b1 /gas/config/tc-m32c.c
parent8e56076649ea3bc861ad1f5ddad9fd931293af10 (diff)
downloadgdb-87975d2a60adf249212c1c031abb4dd0dbb800ac.zip
gdb-87975d2a60adf249212c1c031abb4dd0dbb800ac.tar.gz
gdb-87975d2a60adf249212c1c031abb4dd0dbb800ac.tar.bz2
* config/obj-evax.h (S_SET_OTHER, S_SET_TYPE, S_SET_DESC): Don't define.
* config/tc-crx.c (gettrap): Constify arg. (handle_LoadStor, get_cinv_parameters): Likewise. (getreg_image): Fix enum warning (md_assemble): Restore input line char. * config/tc-hppa.c (tc_gen_reloc): Fix enum warning. * config/tc-i960.c (mem_fmt): Rename var to fix shadow warning. * config/tc-sh.c (sh_fdpic): Only define when OBJ_ELF. (build_Mytes): Fix build failure for non-elf targets. * config/tc-tic4x.c (tic4x_eval): Restore terminator char. * config/tc-xtensa.c (xtensa_end_directive): Fix switch enum warning. * cgen.c (gas_cgen_md_apply_fix): Avoid set but unused warning. * ecoff.c (add_ecoff_symbol): Likewise. * itbl-ops.c (append_insns_as_macros): Likewise. * listing.c (debugging_pseudo): Likewise. * read.c (s_mri_common, stringer): Likewise. * config/obj-coff.c (coff_frob_section): Likewise. * config/tc-alpha.c (emit_ldgp, s_alpha_proc): Likewise. * config/tc-arm.c (my_get_expression): Likewise. * config/tc-hppa.c (process_exit, pa_type_args): Likewise. * config/tc-m32c.c (md_assemble): Likewise. * config/tc-microblaze.c (md_convert_frag): Likewise. * config/tc-mips.c (s_change_section): Likewise. * config/tc-mt.c (mt_fix_adjustable): Likewise. * config/tc-xtensa.c (xtensa_literal_pseudo): Likewise. * config/obj-aout.c (obj_aout_frob_symbol): Delete set but otherwise unused vars. * config/tc-alpha.c (load_expression): Likewise. (s_alpha_rdata, s_alpha_section, s_alpha_prologue): Likewise. * config/tc-arm.c (parse_neon_el_struct_list): Likewise. * config/tc-avr.c (extract_word): Likewise. * config/tc-cris.c (cris_get_expression): Likewise. * config/tc-d30v.c (build_insn, find_format): Likewise. * config/tc-dlx.c (machine_ip): Likewise. * config/tc-hppa.c (pa_get_absolute_expression): Likewise. * config/tc-i370.c (md_assemble): Likewise. * config/tc-i960.c (brtab_emit): Likewise. * config/tc-iq2000.c (s_iq2000_ent): Likewise. * config/tc-m32c.c (md_convert_frag): Likewise. * config/tc-m68hc11.c (fixup24, build_jump_insn): Likewise. (md_estimate_size_before_relax, md_apply_fix): Likewise. * config/tc-m68k.c (md_show_usage): Likewise. * config/tc-microblaze.c (microblaze_s_lcomm): Likewise. * config/tc-mips.c (s_mips_end): Likewise. * config/tc-mmix.c (mmix_byte, mmix_cons): Likewise. * config/tc-mn10300.c (md_assemble): Likewise. * config/tc-msp430.c (extract_word): Likewise. * config/tc-mt.c (md_assemble): Likewise. * config/tc-or32.c (machine_ip): Likewise. * config/tc-pj.c (md_apply_fix): Likewise. * config/tc-s390.c (md_gather_operands): Likewise. * config/tc-sh.c (sh_cons_align): Likewise. * config/tc-sparc.c (sparc_cons_align): Likewise. * config/tc-tic4x.c (tic4x_sect): Likewise. * config/tc-tic54x.c (tic54x_stringer): Likewise. * config/tc-vax.c (vip_op): Likewise. * config/tc-xstormy16.c (xstormy16_cons_fix_new): Likewise. * config/tc-xtensa.c (md_assemble): Likewise. (xtensa_fix_short_loop_frags, convert_frag_immed): Likewise. (xtensa_move_literals): Likewise.
Diffstat (limited to 'gas/config/tc-m32c.c')
-rw-r--r--gas/config/tc-m32c.c77
1 files changed, 11 insertions, 66 deletions
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index cae3302..9c523e2 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -1,5 +1,5 @@
/* tc-m32c.c -- Assembler for the Renesas M32C.
- Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation.
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation.
Contributed by RedHat.
This file is part of GAS, the GNU Assembler.
@@ -359,6 +359,7 @@ md_assemble (char * str)
last_insn_had_delay_slot
= CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT);
+ (void) last_insn_had_delay_slot;
insn_size = CGEN_INSN_BITSIZE(insn.insn);
rl_type = rl_for (insn);
@@ -623,27 +624,20 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
{
int addend;
int operand;
- int new_insn;
int where = fragP->fr_opcode - fragP->fr_literal;
int rl_where = fragP->fr_opcode - fragP->fr_literal;
unsigned char *op = (unsigned char *)fragP->fr_opcode;
- int op_base = 0;
- int op_op = 0;
int rl_addend = 0;
addend = target_address_for (fragP) - (fragP->fr_address + where);
- new_insn = subtype_mappings[fragP->fr_subtype].insn;
fragP->fr_fix = where + subtype_mappings[fragP->fr_subtype].bytes;
- op_base = 0;
-
switch (subtype_mappings[fragP->fr_subtype].insn)
{
case M32C_INSN_JCND16_5:
op[1] = addend - 1;
operand = M32C_OPERAND_LAB_8_8;
- op_op = 1;
rl_addend = 0x21;
break;
@@ -655,9 +649,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[4] = (addend - 3) >> 8;
operand = M32C_OPERAND_LAB_8_16;
where += 2;
- new_insn = M32C_INSN_JMP16_W;
- op_base = 2;
- op_op = 3;
rl_addend = 0x51;
break;
@@ -667,9 +658,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0xfc;
operand = M32C_OPERAND_LAB_8_24;
where += 2;
- new_insn = M32C_INSN_JMP16_A;
- op_base = 2;
- op_op = 3;
rl_addend = 0x61;
break;
@@ -677,8 +665,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
case M32C_INSN_JCND16:
op[2] = addend - 2;
operand = M32C_OPERAND_LAB_16_8;
- op_base = 0;
- op_op = 2;
rl_addend = 0x31;
break;
@@ -690,9 +676,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[5] = (addend - 4) >> 8;
operand = M32C_OPERAND_LAB_8_16;
where += 3;
- new_insn = M32C_INSN_JMP16_W;
- op_base = 3;
- op_op = 4;
rl_addend = 0x61;
break;
@@ -702,17 +685,12 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[3] = 0xfc;
operand = M32C_OPERAND_LAB_8_24;
where += 3;
- new_insn = M32C_INSN_JMP16_A;
- op_base = 3;
- op_op = 4;
rl_addend = 0x71;
break;
case M32C_INSN_JMP16_S:
op[0] = 0x60 | ((addend-2) & 0x07);
operand = M32C_OPERAND_LAB_5_3;
- op_base = 0;
- op_op = 0;
rl_addend = 0x10;
break;
@@ -720,8 +698,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[0] = 0xfe;
op[1] = addend - 1;
operand = M32C_OPERAND_LAB_8_8;
- op_base = 0;
- op_op = 1;
rl_addend = 0x21;
break;
@@ -730,8 +706,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[1] = addend - 1;
op[2] = (addend - 1) >> 8;
operand = M32C_OPERAND_LAB_8_16;
- op_base = 0;
- op_op = 1;
rl_addend = 0x31;
break;
@@ -741,16 +715,12 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0;
op[3] = 0;
operand = M32C_OPERAND_LAB_8_24;
- op_base = 0;
- op_op = 1;
rl_addend = 0x41;
break;
case M32C_INSN_JCND32:
op[1] = addend - 1;
operand = M32C_OPERAND_LAB_8_8;
- op_base = 0;
- op_op = 1;
rl_addend = 0x21;
break;
@@ -762,9 +732,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[4] = (addend - 3) >> 8;
operand = M32C_OPERAND_LAB_8_16;
where += 2;
- new_insn = M32C_INSN_JMP32_W;
- op_base = 2;
- op_op = 3;
rl_addend = 0x51;
break;
@@ -774,20 +741,13 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0xcc;
operand = M32C_OPERAND_LAB_8_24;
where += 2;
- new_insn = M32C_INSN_JMP32_A;
- op_base = 2;
- op_op = 3;
rl_addend = 0x61;
break;
-
-
case M32C_INSN_JMP32_S:
addend = ((addend-2) & 0x07);
op[0] = 0x4a | (addend & 0x01) | ((addend << 3) & 0x30);
operand = M32C_OPERAND_LAB32_JMP_S;
- op_base = 0;
- op_op = 0;
rl_addend = 0x10;
break;
@@ -795,8 +755,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[0] = 0xbb;
op[1] = addend - 1;
operand = M32C_OPERAND_LAB_8_8;
- op_base = 0;
- op_op = 1;
rl_addend = 0x21;
break;
@@ -805,8 +763,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[1] = addend - 1;
op[2] = (addend - 1) >> 8;
operand = M32C_OPERAND_LAB_8_16;
- op_base = 0;
- op_op = 1;
rl_addend = 0x31;
break;
@@ -816,8 +772,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0;
op[3] = 0;
operand = M32C_OPERAND_LAB_8_24;
- op_base = 0;
- op_op = 1;
rl_addend = 0x41;
break;
@@ -827,8 +781,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[1] = addend - 1;
op[2] = (addend - 1) >> 8;
operand = M32C_OPERAND_LAB_8_16;
- op_base = 0;
- op_op = 1;
rl_addend = 0x31;
break;
@@ -838,8 +790,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0;
op[3] = 0;
operand = M32C_OPERAND_LAB_8_24;
- op_base = 0;
- op_op = 1;
rl_addend = 0x41;
break;
@@ -848,8 +798,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[1] = addend - 1;
op[2] = (addend - 1) >> 8;
operand = M32C_OPERAND_LAB_8_16;
- op_base = 0;
- op_op = 1;
rl_addend = 0x31;
break;
@@ -859,8 +807,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
op[2] = 0;
op[3] = 0;
operand = M32C_OPERAND_LAB_8_24;
- op_base = 0;
- op_op = 1;
rl_addend = 0x41;
break;
@@ -885,7 +831,6 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
operand = M32C_OPERAND_LAB_40_8;
break;
-
default:
printf("\nHey! Need more opcode converters! missing: %d %s\n\n",
fragP->fr_subtype,
@@ -909,16 +854,16 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED,
|| (m32c_relax && (operand != M32C_OPERAND_LAB_5_3
&& operand != M32C_OPERAND_LAB32_JMP_S)))
{
- fixS *fixP;
gas_assert (fragP->fr_cgen.insn != 0);
- fixP = gas_cgen_record_fixup (fragP,
- where,
- fragP->fr_cgen.insn,
- (fragP->fr_fix - where) * 8,
- cgen_operand_lookup_by_num (gas_cgen_cpu_desc,
- operand),
- fragP->fr_cgen.opinfo,
- fragP->fr_symbol, fragP->fr_offset);
+ gas_cgen_record_fixup (fragP,
+ where,
+ fragP->fr_cgen.insn,
+ (fragP->fr_fix - where) * 8,
+ cgen_operand_lookup_by_num (gas_cgen_cpu_desc,
+ operand),
+ fragP->fr_cgen.opinfo,
+ fragP->fr_symbol,
+ fragP->fr_offset);
}
}