/* tc-bfin.c -- Assembler for the ADI Blackfin.
- Copyright 2005, 2006, 2007, 2008, 2009
+ Copyright 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
do
{
bfd_reloc_code_real_type reloc_type = BFD_RELOC_BFIN_FUNCDESC;
-
+
if (strncasecmp (input_line_pointer, "funcdesc(", 9) == 0)
{
input_line_pointer += 9;
};
/* Characters that are used to denote comments and line separators. */
-const char comment_chars[] = "";
+const char comment_chars[] = "#";
const char line_comment_chars[] = "#";
const char line_separator_chars[] = ";";
typedef enum bfin_cpu_type
{
BFIN_CPU_UNKNOWN,
+ BFIN_CPU_BF504,
+ BFIN_CPU_BF506,
BFIN_CPU_BF512,
BFIN_CPU_BF514,
BFIN_CPU_BF516,
BFIN_CPU_BF548M,
BFIN_CPU_BF549,
BFIN_CPU_BF549M,
- BFIN_CPU_BF561
+ BFIN_CPU_BF561,
+ BFIN_CPU_BF592,
} bfin_cpu_t;
bfin_cpu_t bfin_cpu_type = BFIN_CPU_UNKNOWN;
struct bfin_cpu bfin_cpus[] =
{
+ {"bf504", BFIN_CPU_BF504, 0x0000, AC_05000074},
+
+ {"bf506", BFIN_CPU_BF506, 0x0000, AC_05000074},
+
+ {"bf512", BFIN_CPU_BF512, 0x0002, AC_05000074},
{"bf512", BFIN_CPU_BF512, 0x0001, AC_05000074},
{"bf512", BFIN_CPU_BF512, 0x0000, AC_05000074},
+ {"bf514", BFIN_CPU_BF514, 0x0002, AC_05000074},
{"bf514", BFIN_CPU_BF514, 0x0001, AC_05000074},
{"bf514", BFIN_CPU_BF514, 0x0000, AC_05000074},
+ {"bf516", BFIN_CPU_BF516, 0x0002, AC_05000074},
{"bf516", BFIN_CPU_BF516, 0x0001, AC_05000074},
{"bf516", BFIN_CPU_BF516, 0x0000, AC_05000074},
+ {"bf518", BFIN_CPU_BF518, 0x0002, AC_05000074},
{"bf518", BFIN_CPU_BF518, 0x0001, AC_05000074},
{"bf518", BFIN_CPU_BF518, 0x0000, AC_05000074},
{"bf542m", BFIN_CPU_BF542M, 0x0003, AC_05000074},
+ {"bf542", BFIN_CPU_BF542, 0x0004, AC_05000074},
{"bf542", BFIN_CPU_BF542, 0x0002, AC_05000074},
{"bf542", BFIN_CPU_BF542, 0x0001, AC_05000074},
{"bf542", BFIN_CPU_BF542, 0x0000, AC_05000074},
{"bf544m", BFIN_CPU_BF544M, 0x0003, AC_05000074},
+ {"bf544", BFIN_CPU_BF544, 0x0004, AC_05000074},
{"bf544", BFIN_CPU_BF544, 0x0002, AC_05000074},
{"bf544", BFIN_CPU_BF544, 0x0001, AC_05000074},
{"bf544", BFIN_CPU_BF544, 0x0000, AC_05000074},
{"bf547m", BFIN_CPU_BF547M, 0x0003, AC_05000074},
+ {"bf547", BFIN_CPU_BF547, 0x0004, AC_05000074},
{"bf547", BFIN_CPU_BF547, 0x0002, AC_05000074},
{"bf547", BFIN_CPU_BF547, 0x0001, AC_05000074},
{"bf547", BFIN_CPU_BF547, 0x0000, AC_05000074},
{"bf548m", BFIN_CPU_BF548M, 0x0003, AC_05000074},
+ {"bf548", BFIN_CPU_BF548, 0x0004, AC_05000074},
{"bf548", BFIN_CPU_BF548, 0x0002, AC_05000074},
{"bf548", BFIN_CPU_BF548, 0x0001, AC_05000074},
{"bf548", BFIN_CPU_BF548, 0x0000, AC_05000074},
{"bf549m", BFIN_CPU_BF549M, 0x0003, AC_05000074},
+ {"bf549", BFIN_CPU_BF549, 0x0004, AC_05000074},
{"bf549", BFIN_CPU_BF549, 0x0002, AC_05000074},
{"bf549", BFIN_CPU_BF549, 0x0001, AC_05000074},
{"bf549", BFIN_CPU_BF549, 0x0000, AC_05000074},
{"bf561", BFIN_CPU_BF561, 0x0003, AC_05000074},
{"bf561", BFIN_CPU_BF561, 0x0002, AC_05000074},
+ {"bf592", BFIN_CPU_BF592, 0x0001, AC_05000074},
+ {"bf592", BFIN_CPU_BF592, 0x0000, AC_05000074},
+
{NULL, 0, 0, 0}
};
/* Ensure that lines can begin with '(', for multiple
register stack pops. */
lex_type ['('] = LEX_BEGIN_NAME;
-
+
#ifdef OBJ_ELF
record_alignment (text_section, 2);
record_alignment (data_section, 2);
#ifdef DEBUG
extern int debug_codeselection;
debug_codeselection = 1;
-#endif
+#endif
last_insn_size = 0;
}
/* Return true if the fix can be handled by GAS, false if it must
be passed through to the linker. */
-bfd_boolean
+bfd_boolean
bfin_fix_adjustable (fixS *fixP)
-{
+{
switch (fixP->fx_r_type)
- {
+ {
/* Adjust_reloc_syms doesn't know about the GOT. */
case BFD_RELOC_BFIN_GOT:
case BFD_RELOC_BFIN_PLTPC:
case BFD_RELOC_VTABLE_INHERIT:
case BFD_RELOC_VTABLE_ENTRY:
return 0;
-
+
default:
return 1;
- }
+ }
}
/* Special extra functions that help bfin-parse.y perform its job. */
return GEN_OPCODE32 ();
}
+INSTR_T
+bfin_gen_pseudochr (int ch)
+{
+ INIT (PseudoChr);
+
+ ASSIGN (ch);
+
+ return GEN_OPCODE16 ();
+}
+
/* Multiple instruction generation. */
INSTR_T
char *lbeginsym, *lendsym;
Expr_Node_Value lbeginval, lendval;
Expr_Node *lbegin, *lend;
+ symbolS *sym;
loopsym = exp->value.s_value;
lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 5);
lbegin = Expr_Node_Create (Expr_Node_Reloc, lbeginval, NULL, NULL);
lend = Expr_Node_Create (Expr_Node_Reloc, lendval, NULL, NULL);
- symbol_remove (symbol_find (loopsym), &symbol_rootP, &symbol_lastP);
+ sym = symbol_find(loopsym);
+ if (!S_IS_LOCAL (sym) || (S_IS_LOCAL (sym) && !symbol_used_p (sym)))
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- return bfin_gen_loopsetup(lbegin, reg, rop, lend, preg);
+ return bfin_gen_loopsetup (lbegin, reg, rop, lend, preg);
+}
+
+void
+bfin_loop_attempt_create_label (Expr_Node *exp, int is_begin)
+{
+ char *name;
+ name = fb_label_name (exp->value.i_value, is_begin);
+ exp->value.s_value = xstrdup (name);
+ exp->type = Expr_Node_Reloc;
}
void
}
return TRUE;
-}
+}
int
bfin_force_relocation (struct fix *fixp)
else if (aop == 0 && aopcde == 24)
return DREG_MASK (dst0);
- else if (aop == 1 && aopcde == 24)
+ else if (aop == 1 && aopcde == 24)
return DREG_MASK (dst0) | DREG_MASK (dst1);
else if (aopcde == 13)
return DREG_MASK (dst0) | DREG_MASK (dst1);