From: Dmitry Selyutin Date: Sun, 28 May 2023 22:04:55 +0000 (+0300) Subject: ppc: share pd_reg definition via libopcodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee6e1fa21b007070d7bdd19eb08f041a7c132117;p=binutils-gdb.git ppc: share pd_reg definition via libopcodes --- diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 47ed37132e7..80f01859379 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -276,14 +276,6 @@ const pseudo_typeS md_pseudo_table[] = In general, there are lots of them, in an attempt to be compatible with a number of other Windows NT assemblers. */ -/* Structure to hold information about predefined registers. */ -struct pd_reg - { - char name[6]; - unsigned short value; - unsigned short flags; - }; - /* List of registers that are pre-defined: Each general register has predefined names of the form: @@ -317,7 +309,7 @@ struct pd_reg The table is sorted. Suitable for searching by a binary search. */ -static const struct pd_reg pre_defined_registers[] = +static const struct powerpc_pd_reg pre_defined_registers[] = { /* VSX accumulators. */ { "a0", 0, PPC_OPERAND_ACC }, @@ -798,8 +790,8 @@ static const struct pd_reg pre_defined_registers[] = /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ -static const struct pd_reg * -reg_name_search (const struct pd_reg *regs, int regcount, const char *name) +static const struct powerpc_pd_reg * +reg_name_search (const struct powerpc_pd_reg *regs, int regcount, const char *name) { int middle, low, high; int cmp; @@ -828,7 +820,7 @@ reg_name_search (const struct pd_reg *regs, int regcount, const char *name) void md_operand (expressionS *expressionP) { - const struct pd_reg *reg; + const struct powerpc_pd_reg *reg; char *name; char *start; char c; @@ -858,7 +850,7 @@ md_operand (expressionS *expressionP) static bool cr_operand; /* Extra names to recognise in a condition code. This table is sorted. */ -static const struct pd_reg cr_cond[] = +static const struct powerpc_pd_reg cr_cond[] = { { "eq", 2, PPC_OPERAND_CR_BIT }, { "gt", 1, PPC_OPERAND_CR_BIT }, @@ -875,7 +867,7 @@ static const struct pd_reg cr_cond[] = void ppc_parse_name (const char *name, expressionS *exp, enum expr_mode mode) { - const struct pd_reg *reg = NULL; + const struct powerpc_pd_reg *reg = NULL; if (cr_operand) reg = reg_name_search (cr_cond, ARRAY_SIZE (cr_cond), name); diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h index e71aa1e86d1..12c65cba88e 100644 --- a/include/opcode/ppc.h +++ b/include/opcode/ppc.h @@ -517,6 +517,14 @@ ppc_optional_operand_value (const struct powerpc_operand *operand, #define E_LI_INSN 0x70000000 #define E_LI_MASK 0xfc008000 +/* Structure to hold information about predefined registers. */ +struct powerpc_pd_reg + { + char name[6]; + unsigned short value; + unsigned short flags; + }; + #ifdef __cplusplus } #endif