From 30cdfbed0247ee03f38db0daa4e211c4517fe3db Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 16 Dec 2002 09:57:49 +0000 Subject: [PATCH] * 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. --- gas/ChangeLog | 6 ++++++ gas/config/tc-d30v.c | 17 ++++++++--------- gas/config/tc-i960.c | 1 + gas/config/tc-mcore.c | 6 +++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index a3741aff56a..c04d5f91a61 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,11 @@ 2002-12-16 Alan Modra + * 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. + * config/tc-ns32k.c (encode_operand): Constify operandsP and suffixP. (parse): Constify line and lineptr. (md_begin): Calculate endop here. diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index d1ab8f49efd..ff15eb8454b 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; } } diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index 0bbbfa698ab..dab0504787f 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -1120,6 +1120,7 @@ md_estimate_size_before_relax (fragP, segment_type) does do the reordering (Ian Taylor 28 Aug 92). *************************************************************************** */ +static void md_ri_to_chars PARAMS ((char *, struct relocation_info *)); static void md_ri_to_chars (where, ri) diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index 569c32df44e..9b59166b910 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -210,7 +210,7 @@ const pseudo_typeS md_pseudo_table[] = { "text", mcore_s_text, 0 }, { "data", mcore_s_data, 0 }, { "bss", mcore_s_bss, 1 }, -#ifdef OBJ_EF +#ifdef OBJ_ELF { "comm", mcore_s_comm, 0 }, #endif { "section", mcore_s_section, 0 }, @@ -639,7 +639,7 @@ dump_literals (isforce) { unsigned int i; struct literal * p; - symbolS * brarsym; + symbolS * brarsym = NULL; if (poolsize == 0) return; @@ -674,7 +674,7 @@ dump_literals (isforce) for (i = 0, p = litpool; i < poolsize; i++, p++) emit_expr (& p->e, 4); - if (isforce) + if (brarsym != NULL) colon (S_GET_NAME (brarsym)); poolsize = 0; -- 2.30.2