diff options
author | Alan Modra <amodra@gmail.com> | 2002-12-16 09:57:49 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-12-16 09:57:49 +0000 |
commit | 30cdfbed0247ee03f38db0daa4e211c4517fe3db (patch) | |
tree | e2b01de66cf3ab4cea994b12b1e9de39988e5f95 /gas/config/tc-d30v.c | |
parent | 3f2a9fb79d4443d59c1566e646a1cbb57e475b2b (diff) | |
download | gdb-30cdfbed0247ee03f38db0daa4e211c4517fe3db.zip gdb-30cdfbed0247ee03f38db0daa4e211c4517fe3db.tar.gz gdb-30cdfbed0247ee03f38db0daa4e211c4517fe3db.tar.bz2 |
* config/tc-d30v.c (check_range): Warning fixes, formatting.
Simplify sign extension. Remove redundant unsigned < 0 test.
* config/tc-i960.c (md_ri_to_chars): Prototype.
* config/tc-mcore.c (md_pseudo_table): Fix typo.
(dump_literals): Init brarsym, and test later instead of isforce.
Diffstat (limited to 'gas/config/tc-d30v.c')
-rw-r--r-- | gas/config/tc-d30v.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index d1ab8f4..ff15eb8 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -252,32 +252,31 @@ check_range (num, bits, flags) Allow either. */ min = -((unsigned long) 1 << (bits - 1)); max = ((unsigned long) 1 << bits) - 1; - return (long)num < min || (long)num > max; + return (long) num < min || (long) num > max; } if (flags & OPERAND_SHIFT) { /* We know that all shifts are right by three bits. */ + num >>= 3; if (flags & OPERAND_SIGNED) - num = (unsigned long) ((long) num >= 0) - ? (((long) num) >> 3) - : ((num >> 3) | ~(~(unsigned long) 0 >> 3)); - else - num >>= 3; + { + unsigned long sign_bit = ((unsigned long) -1L >> 4) + 1; + num = (num ^ sign_bit) - sign_bit; + } } if (flags & OPERAND_SIGNED) { max = ((unsigned long) 1 << (bits - 1)) - 1; min = - ((unsigned long) 1 << (bits - 1)); - return (long)num > max || (long)num < min; + return (long) num > max || (long) num < min; } else { max = ((unsigned long) 1 << bits) - 1; - min = 0; - return num > max || num < min; + return num > (unsigned long) max; } } |