summaryrefslogtreecommitdiff
path: root/gas/expr.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-08-11 02:11:58 +0000
committerMark Mitchell <mark@codesourcery.com>2004-08-11 02:11:58 +0000
commit268a870ad15d3b812eb3f50a64f1cb5a96bd947f (patch)
tree7f781d533f0140568debb9a09b40a05e07a74d00 /gas/expr.c
parentc0424d2263e89a1c2aeb271e28a05ae8ce08bcfa (diff)
downloadbinutils-redhat-268a870ad15d3b812eb3f50a64f1cb5a96bd947f.tar.gz
* expr.c (operand): Handle the "~", "-", and "!" operators applied
to bignums. * gas/arm/bignum1.s: New test. * gas/arm/arm.exp: Run it.
Diffstat (limited to 'gas/expr.c')
-rw-r--r--gas/expr.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gas/expr.c b/gas/expr.c
index d520a04bcd..460a8372dd 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1076,6 +1076,35 @@ operand (expressionS *expressionP)
else
generic_floating_point_number.sign = 'N';
}
+ else if (expressionP->X_op == O_big
+ && expressionP->X_add_number > 0)
+ {
+ int i;
+
+ if (c == '~' || c == '-')
+ {
+ for (i = 0; i < expressionP->X_add_number; ++i)
+ generic_bignum[i] = ~generic_bignum[i];
+ if (c == '-')
+ for (i = 0; i < expressionP->X_add_number; ++i)
+ {
+ generic_bignum[i] += 1;
+ if (generic_bignum[i])
+ break;
+ }
+ }
+ else if (c == '!')
+ {
+ int nonzero = 0;
+ for (i = 0; i < expressionP->X_add_number; ++i)
+ {
+ if (generic_bignum[i])
+ nonzero = 1;
+ generic_bignum[i] = 0;
+ }
+ generic_bignum[0] = nonzero;
+ }
+ }
else if (expressionP->X_op != O_illegal
&& expressionP->X_op != O_absent)
{