aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1997-09-08 23:17:55 +0000
committerNick Clifton <nickc@redhat.com>1997-09-08 23:17:55 +0000
commitb0b262f797b1934829ecc8f51a7ed1f52841342d (patch)
treeac3f896f135f27ffcb74be3cf0e1a6f0d86e148d /gas/config
parent8816811b859e4f63d44a43f57a8c86ecde3c2f25 (diff)
downloadgdb-b0b262f797b1934829ecc8f51a7ed1f52841342d.zip
gdb-b0b262f797b1934829ecc8f51a7ed1f52841342d.tar.gz
gdb-b0b262f797b1934829ecc8f51a7ed1f52841342d.tar.bz2
Only test for immediaqte overflow if there is no insertion function.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-v850.c83
1 files changed, 42 insertions, 41 deletions
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index cb200a5..524e735 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1667,46 +1667,6 @@ v850_insert_operand (insn, operand, val, file, line)
char *file;
unsigned int line;
{
- if (operand->bits != 32)
- {
- long min, max;
- offsetT test;
-
- if ((operand->flags & V850_OPERAND_SIGNED) != 0)
- {
- if (! warn_signed_overflows)
- max = (1 << operand->bits) - 1;
- else
- max = (1 << (operand->bits - 1)) - 1;
-
- min = - (1 << (operand->bits - 1));
- }
- else
- {
- max = (1 << operand->bits) - 1;
-
- if (! warn_unsigned_overflows)
- min = - (1 << (operand->bits - 1));
- else
- min = 0;
- }
-
- test = val;
-
- if (test < (offsetT) min || test > (offsetT) max)
- {
- const char * err =
- "operand out of range (%s not between %ld and %ld)";
- char buf[100];
-
- sprint_value (buf, test);
- if (file == (char *) NULL)
- as_warn (err, buf, min, max);
- else
- as_warn_where (file, line, err, buf, min, max);
- }
- }
-
if (operand->insert)
{
const char * message = NULL;
@@ -1721,7 +1681,48 @@ v850_insert_operand (insn, operand, val, file, line)
}
}
else
- insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift);
+ {
+ if (operand->bits != 32)
+ {
+ long min, max;
+ offsetT test;
+
+ if ((operand->flags & V850_OPERAND_SIGNED) != 0)
+ {
+ if (! warn_signed_overflows)
+ max = (1 << operand->bits) - 1;
+ else
+ max = (1 << (operand->bits - 1)) - 1;
+
+ min = - (1 << (operand->bits - 1));
+ }
+ else
+ {
+ max = (1 << operand->bits) - 1;
+
+ if (! warn_unsigned_overflows)
+ min = - (1 << (operand->bits - 1));
+ else
+ min = 0;
+ }
+
+ test = val;
+
+ if (test < (offsetT) min || test > (offsetT) max)
+ {
+ const char * err = "operand out of range (%s not between %ld and %ld)";
+ char buf[100];
+
+ sprint_value (buf, test);
+ if (file == (char *) NULL)
+ as_warn (err, buf, min, max);
+ else
+ as_warn_where (file, line, err, buf, min, max);
+ }
+ }
+
+ insn |= (((long) val & ((1 << operand->bits) - 1)) << operand->shift);
+ }
return insn;
}