diff options
Diffstat (limited to 'gas/config/tc-d10v.c')
-rw-r--r-- | gas/config/tc-d10v.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 33926fb..7161a6b 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -196,10 +196,19 @@ check_range (num, bits, flags) if (flags & OPERAND_SIGNED) { - max = (1 << (bits - 1))-1; - min = - (1 << (bits - 1)); - if (((long)num > max) || ((long)num < min)) - retval = 1; + /* Signed 3-bit integers are restricted to the (-2, 3) range */ + if (flags & RESTRICTED_NUM3) + { + if ((long) num < -2 || (long) num > 3) + retval = 1; + } + else + { + max = (1 << (bits - 1)) - 1; + min = - (1 << (bits - 1)); + if (((long) num > max) || ((long) num < min)) + retval = 1; + } } else { |