+2010-09-11 David Gibson <david.gibson@analog.com>
+
+ * config/bfin-aux.h (bfin_loop_attempt_create_label): New prototype.
+ * config/bfin-parse.y (LOOP_BEGIN, LOOP_END): Handle numeric labels.
+ * config/tc-bfin.c (bfin_loop_attempt_create_label): New funtion.
+
2010-09-11 David Gibson <david.gibson@analog.com>
* config/tc-bfin.c (bfin_gen_loop): Check symbol before removing.
INSTR_T bfin_gen_progctrl (int, int);
INSTR_T bfin_gen_loopsetup (Expr_Node *, REG_T, int, Expr_Node *, REG_T);
INSTR_T bfin_gen_loop (Expr_Node *, REG_T, int, REG_T);
+void bfin_loop_attempt_create_label (Expr_Node *, int);
void bfin_loop_beginend (Expr_Node *, int);
INSTR_T bfin_gen_pushpopmultiple (int, int, int, int, int);
INSTR_T bfin_gen_pushpopreg (REG_T, int);
}
/* LOOP_BEGIN. */
+ | LOOP_BEGIN NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_BEGIN statement");
+ bfin_loop_beginend (tmp, 1);
+ $$ = 0;
+ }
| LOOP_BEGIN expr
{
if (!IS_RELOC ($2))
}
/* LOOP_END. */
+ | LOOP_END NUMBER
+ {
+ Expr_Node_Value val;
+ val.i_value = $2;
+ Expr_Node *tmp = Expr_Node_Create (Expr_Node_Constant, val, NULL, NULL);
+ bfin_loop_attempt_create_label (tmp, 1);
+ if (!IS_RELOC (tmp))
+ return yyerror ("Invalid expression in LOOP_END statement");
+ bfin_loop_beginend (tmp, 0);
+ $$ = 0;
+ }
| LOOP_END expr
{
if (!IS_RELOC ($2))
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
bfin_loop_beginend (Expr_Node *exp, int begin)
{