diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-08-11 02:11:58 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2004-08-11 02:11:58 +0000 |
commit | 268a870ad15d3b812eb3f50a64f1cb5a96bd947f (patch) | |
tree | 7f781d533f0140568debb9a09b40a05e07a74d00 | |
parent | c0424d2263e89a1c2aeb271e28a05ae8ce08bcfa (diff) | |
download | binutils-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.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/expr.c | 29 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/arm.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/bignum1.s | 1 |
5 files changed, 41 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 4361aa3a16..bbd1ec2306 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Mark Mitchell <mark@codesourcery.com> + + * expr.c (operand): Handle the "~", "-", and "!" operators applied + to bignums. + 2004-08-06 Paul Brook <paul@codesourcery.com> * config/tc-arm.c (md_apply_fix3, tc_gen_reloc, arm_parse_reloc): 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) { diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index f91cf6d1b1..e61fd49f04 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-10 Mark Mitchell <mark@codesourcery.com> + + * gas/arm/bignum1.s: New test. + * gas/arm/arm.exp: Run it. + 2004-08-06 Paul Brook <paul@codesourcery.com> * gas/arm/pic.s,d: Test RELABS and SBREL relocations. diff --git a/gas/testsuite/gas/arm/arm.exp b/gas/testsuite/gas/arm/arm.exp index 36045e6c1e..1681ab984c 100644 --- a/gas/testsuite/gas/arm/arm.exp +++ b/gas/testsuite/gas/arm/arm.exp @@ -35,6 +35,7 @@ if {[istarget *arm*-*-*] || [istarget "xscale-*-*"]} then { gas_test "immed.s" "" $stdoptlist "immediate expressions" gas_test "float.s" "-mcpu=arm7tdmi -mfpu=fpa" $stdoptlist "Core floating point instructions" gas_test "offset.s" "" $stdoptlist "OFFSET_IMM regression" + gas_test "bignum1.s" "" $stdoptlist "bignums" run_dump_test "armv1" run_dump_test "arch5tej" diff --git a/gas/testsuite/gas/arm/bignum1.s b/gas/testsuite/gas/arm/bignum1.s new file mode 100644 index 0000000000..3c45d23ff5 --- /dev/null +++ b/gas/testsuite/gas/arm/bignum1.s @@ -0,0 +1 @@ + .8byte -9223372036854775808 |