aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-09-09 07:40:11 +0000
committerNick Clifton <nickc@redhat.com>2010-09-09 07:40:11 +0000
commit95b75c0115a8dfef2afcefd3db9f191383b7376f (patch)
tree85746503557cf3075419991c4de43045950d3229
parenta6577478747c667c553f5464cf6de81b0052cb37 (diff)
downloadgdb-95b75c0115a8dfef2afcefd3db9f191383b7376f.zip
gdb-95b75c0115a8dfef2afcefd3db9f191383b7376f.tar.gz
gdb-95b75c0115a8dfef2afcefd3db9f191383b7376f.tar.bz2
PR gas/11972
* config/tc-arm.c (parse_big_immediate): Allow for bignums being extended to the size of a .octa.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c22
2 files changed, 26 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index fd79897..cef0c18 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-09 Nick Clifton <nickc@redhat.com>
+
+ PR gas/11972
+ * config/tc-arm.c (parse_big_immediate): Allow for bignums being
+ extended to the size of a .octa.
+
2010-09-08 Julian Brown <julian@codesourcery.com>
* config/tc-arm.c (create_neon_reg_alias): Deal with case
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 87b2b85..ce32aef 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -4420,14 +4420,32 @@ parse_big_immediate (char **str, int i)
}
}
else if (exp.X_op == O_big
- && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number > 32
- && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number <= 64)
+ && LITTLENUM_NUMBER_OF_BITS * exp.X_add_number > 32)
{
unsigned parts = 32 / LITTLENUM_NUMBER_OF_BITS, j, idx = 0;
+
/* Bignums have their least significant bits in
generic_bignum[0]. Make sure we put 32 bits in imm and
32 bits in reg, in a (hopefully) portable way. */
gas_assert (parts != 0);
+
+ /* Make sure that the number is not too big.
+ PR 11972: Bignums can now be sign-extended to the
+ size of a .octa so check that the out of range bits
+ are all zero or all one. */
+ if (LITTLENUM_NUMBER_OF_BITS * exp.X_add_number > 64)
+ {
+ LITTLENUM_TYPE m = -1;
+
+ if (generic_bignum[parts * 2] != 0
+ && generic_bignum[parts * 2] != m)
+ return FAIL;
+
+ for (j = parts * 2 + 1; j < (unsigned) exp.X_add_number; j++)
+ if (generic_bignum[j] != generic_bignum[j-1])
+ return FAIL;
+ }
+
inst.operands[i].imm = 0;
for (j = 0; j < parts; j++, idx++)
inst.operands[i].imm |= generic_bignum[idx]