static void
ppc_parse_name_common (const char *name,
- expressionS *exp, enum expr_mode mode,
+ expressionS *exp, enum expr_mode mode, bool operand,
const struct powerpc_pd_reg *regs, size_t num);
static void
/* Called for a non-symbol, non-number operand. Handles %reg. */
static void
-ppc_operand_common (expressionS *expressionP,
+ppc_operand_common (expressionS *exp,
const struct powerpc_pd_reg *regs, size_t num)
{
char endc;
char *name;
- const struct powerpc_pd_reg *reg;
endc = get_symbol_name (&name);
- reg = reg_name_search (regs, num, name);
+ ppc_parse_name_common (name, exp, expr_normal, true, regs, num);
restore_line_pointer (endc);
-
- if (reg != NULL)
- {
- expressionP->X_op = O_register;
- expressionP->X_add_number = reg->value;
- expressionP->X_md = reg->flags;
- }
}
static void
static void
ppc_parse_name_common (const char *name,
- expressionS *exp, enum expr_mode mode,
+ expressionS *exp, enum expr_mode mode, bool operand,
const struct powerpc_pd_reg *regs, size_t num)
{
const struct powerpc_pd_reg *reg = NULL;
if (cr_operand)
reg = reg_name_search (cr_cond, ARRAY_SIZE (cr_cond), name);
- if (reg == NULL && (cr_operand || reg_names_p))
+ if (reg == NULL && (operand || cr_operand || reg_names_p))
reg = reg_name_search (regs, num, name);
if (reg != NULL)
{
static void
ppc_parse_name_default (const char *name, expressionS *exp, enum expr_mode mode)
{
- ppc_parse_name_common (name, exp, mode,
+ ppc_parse_name_common (name, exp, mode, false,
pre_defined_registers, ARRAY_SIZE (pre_defined_registers));
}