From 6d67b4c74da3e8a09925f5821b6e9df3352f9934 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 15 Aug 2012 11:39:52 +0000 Subject: [PATCH] double-int.h (double_int::from_unsigned): Rename to ... 2012-08-15 Richard Guenther * double-int.h (double_int::from_unsigned): Rename to ... (double_int::from_uhwi): ... this. (double_int::from_signed): Rename to ... (double_int::from_shwi): ... this. (double_int::to_signed): Rename to ... (double_int::to_shwi): ... this. (double_int::to_unsigned): Rename to ... (double_int::to_uhwi): ... this. (double_int::fits_unsigned): Rename to ... (double_int::fits_uhwi): ... this. (double_int::fits_signed): Rename to ... (double_int::fits_shwi): ... this. (double_int::fits): Rename to ... (double_int::fits_hwi): ... this. * double-int.c: Likewise. From-SVN: r190410 --- gcc/ChangeLog | 18 ++++++++++++++++++ gcc/double-int.c | 8 ++++---- gcc/double-int.h | 48 ++++++++++++++++++++++++------------------------ 3 files changed, 46 insertions(+), 28 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e400a76f5761..177b5c6725ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2012-08-15 Richard Guenther + + * double-int.h (double_int::from_unsigned): Rename to ... + (double_int::from_uhwi): ... this. + (double_int::from_signed): Rename to ... + (double_int::from_shwi): ... this. + (double_int::to_signed): Rename to ... + (double_int::to_shwi): ... this. + (double_int::to_unsigned): Rename to ... + (double_int::to_uhwi): ... this. + (double_int::fits_unsigned): Rename to ... + (double_int::fits_uhwi): ... this. + (double_int::fits_signed): Rename to ... + (double_int::fits_shwi): ... this. + (double_int::fits): Rename to ... + (double_int::fits_hwi): ... this. + * double-int.c: Likewise. + 2012-08-15 Steven Bosscher * timevar.def (TV_VARPOOL, TV_WHOPR_WPA_LTRANS_EXEC, TV_LIFE, diff --git a/gcc/double-int.c b/gcc/double-int.c index 2f48f2b3049b..3a22d15f08cd 100644 --- a/gcc/double-int.c +++ b/gcc/double-int.c @@ -716,7 +716,7 @@ double_int::sext (unsigned prec) const /* Returns true if CST fits in signed HOST_WIDE_INT. */ bool -double_int::fits_signed () const +double_int::fits_shwi () const { const double_int &cst = *this; if (cst.high == 0) @@ -731,12 +731,12 @@ double_int::fits_signed () const unsigned HOST_WIDE_INT if UNS is true. */ bool -double_int::fits (bool uns) const +double_int::fits_hwi (bool uns) const { if (uns) - return this->fits_unsigned (); + return this->fits_uhwi (); else - return this->fits_signed (); + return this->fits_shwi (); } /* Returns A * B. */ diff --git a/gcc/double-int.h b/gcc/double-int.h index 9bbf644603c4..3d9aa2caa9de 100644 --- a/gcc/double-int.h +++ b/gcc/double-int.h @@ -60,8 +60,8 @@ public: Second, the GCC conding conventions prefer explicit conversion, and explicit conversion operators are not available until C++11. */ - static double_int from_unsigned (unsigned HOST_WIDE_INT cst); - static double_int from_signed (HOST_WIDE_INT cst); + static double_int from_uhwi (unsigned HOST_WIDE_INT cst); + static double_int from_shwi (HOST_WIDE_INT cst); /* No copy assignment operator or destructor to keep the type a POD. */ @@ -83,14 +83,14 @@ public: /* Conversion functions. */ - HOST_WIDE_INT to_signed () const; - unsigned HOST_WIDE_INT to_unsigned () const; + HOST_WIDE_INT to_shwi () const; + unsigned HOST_WIDE_INT to_uhwi () const; /* Conversion query functions. */ - bool fits_unsigned () const; - bool fits_signed () const; - bool fits (bool uns) const; + bool fits_uhwi () const; + bool fits_shwi () const; + bool fits_hwi (bool uns) const; /* Attribute query functions. */ @@ -186,7 +186,7 @@ public: HOST_WIDE_INT are filled with the sign bit. */ inline -double_int double_int::from_signed (HOST_WIDE_INT cst) +double_int double_int::from_shwi (HOST_WIDE_INT cst) { double_int r; r.low = (unsigned HOST_WIDE_INT) cst; @@ -198,7 +198,7 @@ double_int double_int::from_signed (HOST_WIDE_INT cst) static inline double_int shwi_to_double_int (HOST_WIDE_INT cst) { - return double_int::from_signed (cst); + return double_int::from_shwi (cst); } /* Some useful constants. */ @@ -206,17 +206,17 @@ shwi_to_double_int (HOST_WIDE_INT cst) The problem is that a named constant would not be as optimizable, while the functional syntax is more verbose. */ -#define double_int_minus_one (double_int::from_signed (-1)) -#define double_int_zero (double_int::from_signed (0)) -#define double_int_one (double_int::from_signed (1)) -#define double_int_two (double_int::from_signed (2)) -#define double_int_ten (double_int::from_signed (10)) +#define double_int_minus_one (double_int::from_shwi (-1)) +#define double_int_zero (double_int::from_shwi (0)) +#define double_int_one (double_int::from_shwi (1)) +#define double_int_two (double_int::from_shwi (2)) +#define double_int_ten (double_int::from_shwi (10)) /* Constructs double_int from unsigned integer CST. The bits over the precision of HOST_WIDE_INT are filled with zeros. */ inline -double_int double_int::from_unsigned (unsigned HOST_WIDE_INT cst) +double_int double_int::from_uhwi (unsigned HOST_WIDE_INT cst) { double_int r; r.low = cst; @@ -228,7 +228,7 @@ double_int double_int::from_unsigned (unsigned HOST_WIDE_INT cst) static inline double_int uhwi_to_double_int (unsigned HOST_WIDE_INT cst) { - return double_int::from_unsigned (cst); + return double_int::from_uhwi (cst); } inline double_int & @@ -270,7 +270,7 @@ double_int::operator -= (double_int b) double_int::fits_signed. */ inline HOST_WIDE_INT -double_int::to_signed () const +double_int::to_shwi () const { return (HOST_WIDE_INT) low; } @@ -279,14 +279,14 @@ double_int::to_signed () const static inline HOST_WIDE_INT double_int_to_shwi (double_int cst) { - return cst.to_signed (); + return cst.to_shwi (); } /* Returns value of CST as an unsigned number. CST must satisfy double_int::fits_unsigned. */ inline unsigned HOST_WIDE_INT -double_int::to_unsigned () const +double_int::to_uhwi () const { return low; } @@ -295,13 +295,13 @@ double_int::to_unsigned () const static inline unsigned HOST_WIDE_INT double_int_to_uhwi (double_int cst) { - return cst.to_unsigned (); + return cst.to_uhwi (); } /* Returns true if CST fits in unsigned HOST_WIDE_INT. */ inline bool -double_int::fits_unsigned () const +double_int::fits_uhwi () const { return high == 0; } @@ -310,7 +310,7 @@ double_int::fits_unsigned () const static inline bool double_int_fits_in_uhwi_p (double_int cst) { - return cst.fits_unsigned (); + return cst.fits_uhwi (); } /* Returns true if CST fits in signed HOST_WIDE_INT. */ @@ -319,14 +319,14 @@ double_int_fits_in_uhwi_p (double_int cst) inline bool double_int_fits_in_shwi_p (double_int cst) { - return cst.fits_signed (); + return cst.fits_shwi (); } /* FIXME(crowl): Remove after converting callers. */ inline bool double_int_fits_in_hwi_p (double_int cst, bool uns) { - return cst.fits (uns); + return cst.fits_hwi (uns); } /* The following operations perform arithmetics modulo 2^precision,