summaryrefslogtreecommitdiff
path: root/gcc/double-int.c
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2016-07-19 18:40:55 +0200
committerUros Bizjak <uros@gcc.gnu.org>2016-07-19 18:40:55 +0200
commitfecfbfa4a290992437a99977381e29815ed9199d (patch)
treed187dacf2ba515208c78754cda80de5b3a012926 /gcc/double-int.c
parent5989388cdfa7b757a9aab117f4dcabea147050a8 (diff)
downloadgcc-fecfbfa4a290992437a99977381e29815ed9199d.tar.gz
builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1...
* builtins.c: Use HOST_WIDE_INT_1 instead of (HOST_WIDE_INT) 1, HOST_WIDE_INT_1U instead of (unsigned HOST_WIDE_INT) 1, HOST_WIDE_INT_M1 instead of (HOST_WIDE_INT) -1 and HOST_WIDE_INT_M1U instead of (unsigned HOST_WIDE_INT) -1. * combine.c: Ditto. * cse.c: Ditto. * dojump.c: Ditto. * double-int.c: Ditto. * dse.c: Ditto. * dwarf2out.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * fwprop.c: Ditto. * genmodes.c: Ditto. * hwint.c: Ditto. * hwint.h: Ditto. * ifcvt.c: Ditto. * loop-doloop.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * match.pd: Ditto. * optabs.c: Ditto. * real.c: Ditto. * reload.c: Ditto. * rtlanal.c: Ditto. * simplify-rtx.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-patterns.c: Ditto. * tree.c: Ditto. * tree.h: Ditto. * ubsan.c: Ditto. * varasm.c: Ditto. * wide-int-print.cc: Ditto. * wide-int.cc: Ditto. * wide-int.h: Ditto. From-SVN: r238481
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r--gcc/double-int.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c
index 1c4e8e310cb..8a273907a6f 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -65,10 +65,10 @@ static int div_and_round_double (unsigned, int, unsigned HOST_WIDE_INT,
number. The value of the word is LOWPART + HIGHPART * BASE. */
#define LOWPART(x) \
- ((x) & (((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) - 1))
+ ((x) & ((HOST_WIDE_INT_1U << (HOST_BITS_PER_WIDE_INT / 2)) - 1))
#define HIGHPART(x) \
((unsigned HOST_WIDE_INT) (x) >> HOST_BITS_PER_WIDE_INT / 2)
-#define BASE ((unsigned HOST_WIDE_INT) 1 << HOST_BITS_PER_WIDE_INT / 2)
+#define BASE (HOST_WIDE_INT_1U << HOST_BITS_PER_WIDE_INT / 2)
/* Unpack a two-word integer into 4 words.
LOW and HI are the integer, as two `HOST_WIDE_INT' pieces.
@@ -546,7 +546,7 @@ div_and_round_double (unsigned code, int uns,
if (quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio < 0 && rem != 0 */
{
/* quo = quo - 1; */
- add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1,
+ add_double (*lquo, *hquo, HOST_WIDE_INT_M1, HOST_WIDE_INT_M1,
lquo, hquo);
}
else
@@ -557,7 +557,7 @@ div_and_round_double (unsigned code, int uns,
case CEIL_MOD_EXPR: /* round toward positive infinity */
if (!quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio > 0 && rem != 0 */
{
- add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
+ add_double (*lquo, *hquo, HOST_WIDE_INT_1, (HOST_WIDE_INT) 0,
lquo, hquo);
}
else
@@ -590,10 +590,10 @@ div_and_round_double (unsigned code, int uns,
if (quo_neg)
/* quo = quo - 1; */
add_double (*lquo, *hquo,
- (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo);
+ HOST_WIDE_INT_M1, HOST_WIDE_INT_M1, lquo, hquo);
else
/* quo = quo + 1; */
- add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0,
+ add_double (*lquo, *hquo, HOST_WIDE_INT_1, (HOST_WIDE_INT) 0,
lquo, hquo);
}
else
@@ -1058,9 +1058,9 @@ double_int::set_bit (unsigned bitpos) const
{
double_int a = *this;
if (bitpos < HOST_BITS_PER_WIDE_INT)
- a.low |= (unsigned HOST_WIDE_INT) 1 << bitpos;
+ a.low |= HOST_WIDE_INT_1U << bitpos;
else
- a.high |= (HOST_WIDE_INT) 1 << (bitpos - HOST_BITS_PER_WIDE_INT);
+ a.high |= HOST_WIDE_INT_1 << (bitpos - HOST_BITS_PER_WIDE_INT);
return a;
}