From 7e0de605cbacbbbb2531bb70506c0843aea13111 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 14 Feb 2017 20:38:21 +1030 Subject: 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. --- gas/NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gas/NEWS') diff --git a/gas/NEWS b/gas/NEWS index e95a9d8..ef0780d 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -1,5 +1,9 @@ -*- text -*- +* PowerPC gas now checks that the correct register class is used in + instructions. For instance, "addi %f4,%cr3,%r31" is now rejected + rather than silently producing "addi r4,r3,31". + * Add support for the Texas Instruments PRU processor. Changes in 2.28: -- cgit v1.1