diff options
author | Alan Modra <amodra@gmail.com> | 2022-07-12 11:10:08 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-07-14 11:58:40 +0930 |
commit | 00b37cc41e699faa30435fb6a302311a5ad44a3d (patch) | |
tree | 6eaea925dac041af3cefcdb34eba7e5dbc81ff73 /gas/read.c | |
parent | 869fa2b36cb2db03deda55225560a2f93d98cc0b (diff) | |
download | binutils-00b37cc41e699faa30435fb6a302311a5ad44a3d.zip binutils-00b37cc41e699faa30435fb6a302311a5ad44a3d.tar.gz binutils-00b37cc41e699faa30435fb6a302311a5ad44a3d.tar.bz2 |
PowerPC: implement md_operand to parse register names
Allows register names to appear in symbol assignments, so for example
tocp = %r2
mr %r3,tocp
now assembles.
* gas/config/tc-ppc.c (REG_NAME_CNT): Delete, replace uses with
ARRAY_SIZE.
(register_name): Rename to..
(md_operand): ..this. Only handle %reg.
(cr_names): Rename to..
(cr_cond): ..this. Just keep conditions.
(ppc_parse_name): Add mode param. Search both cr_cond and
pre_defined_registers. Handle absolute and register symbol
values here rather than in expr.c:operand().
(md_assemble): Don't special case register name matching in
operands, except to set cr_operand as appropriate.
* gas/config/tc-ppc.h (md_operand): Don't define.
(md_parse_name, ppc_parse_name): Update.
* read.c (pseudo_set): Copy over entire O_register value.
* testsuite/gas/ppc/regsyms.d.
* testsuite/gas/ppc/regsyms.s: New test.
* testsuite/gas/ppc/ppc.exp: Run it.
Diffstat (limited to 'gas/read.c')
-rw-r--r-- | gas/read.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -3934,10 +3934,9 @@ pseudo_set (symbolS *symbolP) return; } #endif + symbol_set_value_expression (symbolP, &exp); S_SET_SEGMENT (symbolP, reg_section); - S_SET_VALUE (symbolP, (valueT) exp.X_add_number); set_zero_frag (symbolP); - symbol_get_value_expression (symbolP)->X_op = O_register; break; case O_symbol: |