From: Nick Clifton Date: Mon, 8 Sep 1997 23:17:55 +0000 (+0000) Subject: Only test for immediaqte overflow if there is no insertion function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0b262f797b1934829ecc8f51a7ed1f52841342d;p=binutils-gdb.git Only test for immediaqte overflow if there is no insertion function. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 4b004c353a9..bc90d503635 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,8 @@ Mon Sep 8 12:33:40 1997 Nick Clifton + * config/tc-v850.c (v850_insert_operand): Only test for overflow + if there is no insert function. + * config/tc-v850.h (TARGET_MACHINE): New constant. * config/tc-v850.c (v850_insert_operand): Add diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index cb200a5b03f..524e73592be 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; }