summaryrefslogtreecommitdiff
path: root/gas/expr.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-12 09:02:46 +0930
committerAlan Modra <amodra@gmail.com>2021-04-12 11:57:03 +0930
commit32d715691aa037f2838b41fa257c2e239d67c134 (patch)
tree15950d786cf30650203914068f191717acacae46 /gas/expr.h
parentfc304b889106f6d1bd720e969b95615992bf1961 (diff)
Power10 bignum operands
When built on a 32-bit host without --enable-64-bit-bfd, powerpc-linux and other 32-bit powerpc targeted binutils fail to assemble some power10 prefixed instructions with 34-bit fields. A typical error seen when running the testsuite is .../gas/testsuite/gas/ppc/prefix-pcrel.s:10: Error: bignum invalid In practice this doesn't matter for addresses: 32-bit programs don't need or use the top 2 bits of a d34 field when calculating addresses. However it may matter when loading or adding 64-bit constants with paddi. A power10 processor in 32-bit mode still has 64-bit wide GPRs. So this patch enables limited support for O_big PowerPC operands, and corrects sign extension of 32-bit constants using X_extrabit. * config/tc-ppc.c (insn_validate): Use uint64_t for operand values. (md_assemble): Likewise. Handle bignum operands. (ppc_elf_suffix): Handle O_big. Remove unnecessary input_line_pointer check. * expr.c: Delete unnecessary forward declarations. (generic_bignum_to_int32): Return uint32_t. (generic_bignum_to_int64): Return uint64_t. Compile always. (operand): Twiddle X_extrabit for unary '~'. Set X_unsigned and clear X_extrabit for unary '!'. * expr.h (generic_bignum_to_int32): Declare. (generic_bignum_to_int64): Declare. * testsuite/gas/ppc/prefix-pcrel.s, * testsuite/gas/ppc/prefix-pcrel.d: Add more instructions.
Diffstat (limited to 'gas/expr.h')
-rw-r--r--gas/expr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gas/expr.h b/gas/expr.h
index 5537039edd..e870712736 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -185,6 +185,8 @@ extern void current_location (expressionS *);
extern symbolS *expr_build_uconstant (offsetT);
extern symbolS *expr_build_dot (void);
+extern uint32_t generic_bignum_to_int32 (void);
+extern uint64_t generic_bignum_to_int64 (void);
int resolve_expression (expressionS *);