diff options
author | Alan Modra <amodra@gmail.com> | 2017-02-14 20:38:21 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-02-14 21:12:07 +1030 |
commit | 7e0de605cbacbbbb2531bb70506c0843aea13111 (patch) | |
tree | 70e16baeeedac264df23c6d884e95743dcbc570f /gas/config/tc-ppc.h | |
parent | 606a935e3a9066ab11308b8c934c9bdec7f128d3 (diff) | |
download | gdb-7e0de605cbacbbbb2531bb70506c0843aea13111.zip gdb-7e0de605cbacbbbb2531bb70506c0843aea13111.tar.gz gdb-7e0de605cbacbbbb2531bb70506c0843aea13111.tar.bz2 |
PowerPC register expression checks
This stops powerpc gas blithely accepting such nonsense as
"addi %f4,%cr3,%r31".
PR 21118
gas/
* NEWS: Mention powerpc register checks.
* config/tc-ppc.c (struct pd_reg): Make value a short. Add flags.
(pre_defined_registers): Delete fpscr and pmr entries. Set
register type in flags.
(cr_names): Set type in flags.
(reg_name_search): Return pointer to struct pd_reg rather than value.
(register_name): Adjust to suit. Set X_md from flags.
(ppc_parse_name): Likewise.
(ppc_optimize_expr): New function.
(md_assemble): Verify expresion reg flags match operand.
* config/tc-ppc.h (md_optimize_expr): Define.
(ppc_optimize_expr): Declare.
include/
* opcode/ppc.h (PPC_OPERAND_*): Reassign values, regs first.
(PPC_OPERAND_SPR, PPC_OPERAND_GQR): Define.
opcodes/
* ppc-opc.c (powerpc_operands): Flag SPR, SPRG and TBR entries
with PPC_OPERAND_SPR. Flag PSQ and PSQM with PPC_OPERAND_GQR.
Diffstat (limited to 'gas/config/tc-ppc.h')
-rw-r--r-- | gas/config/tc-ppc.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index e739f9c..077224b 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -264,6 +264,9 @@ extern long md_pcrel_from_section (struct fix *, segT); #define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp) extern int ppc_parse_name (const char *, struct expressionS *); +#define md_optimize_expr(left, op, right) ppc_optimize_expr (left, op, right) +extern int ppc_optimize_expr (expressionS *, operatorT, expressionS *); + #define md_operand(x) #define md_cleanup() ppc_cleanup () |