summaryrefslogtreecommitdiff
path: root/gas/expr.h
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2013-04-11 10:54:13 +0000
committerJulian Brown <julian@codesourcery.com>2013-04-11 10:54:13 +0000
commitf670ad2837603736a24921ba665918e0dffc7eeb (patch)
treedac922542cbdf31b499c2a3b50bead5cd6ded614 /gas/expr.h
parent2de5269423ac254062466d075ae905803831eb03 (diff)
downloadbinutils-redhat-f670ad2837603736a24921ba665918e0dffc7eeb.tar.gz
gas/
* read.c (convert_to_bignum): Add sign parameter. Use it instead of X_unsigned to determine sign of resulting bignum. (emit_expr): Pass extra argument to convert_to_bignum. (emit_leb128_expr): Use X_extrabit instead of X_unsigned. Pass X_extrabit to convert_to_bignum. (parse_bitfield_cons): Set X_extrabit. * expr.c (make_expr_symbol, expr_build_uconstant, operand): Initialise X_extrabit field as appropriate. (add_to_result): New. (subtract_from_result): New. (expr): Use above. * expr.h (expressionS): Add X_extrabit field. gas/testsuite/ * gas/all/sleb128-2.s: New test. * gas/all/sleb128-3.s: Likewise. * gas/all/sleb128-4.s: Likewise. * gas/all/sleb128-5.s: Likewise. * gas/all/sleb128-7.s: Likewise. * gas/all/sleb128-2.d: New. * gas/all/sleb128-3.d: New. * gas/all/sleb123-4.d: New. * gas/all/sleb123-5.d: New. * gas/all/sleb123-7.d: New. * gas/all/gas.exp (sleb128-2, sleb128-3, sleb128-4, sleb128-5) (sleb128-7): Run new tests.
Diffstat (limited to 'gas/expr.h')
-rw-r--r--gas/expr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gas/expr.h b/gas/expr.h
index cce932dc14..d2cb7fd50f 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -136,6 +136,11 @@ typedef struct expressionS {
when performing arithmetic on these values).
FIXME: This field is not set very reliably. */
unsigned int X_unsigned : 1;
+ /* This is used to implement "word size + 1 bit" arithmetic, so that e.g.
+ expressions used with .sleb128 directives can use the full range available
+ for an unsigned word, but can also properly represent all values of a
+ signed word. */
+ unsigned int X_extrabit : 1;
/* 7 additional bits can be defined if needed. */