From a6caa15fd850657e54b7503695521137c0d55dff Mon Sep 17 00:00:00 2001 From: aesok Date: Mon, 5 Jul 2010 18:45:40 +0000 Subject: * double-int.h (fit_double_type): Remove declaration. * double-int.c (fit_double_type): Remove function. * tree.h (int_fits_type_p): Adjust prototype. * tree.c (int_fits_type_p): Return bool. Use double_int_fits_to_tree_p instead of fit_double_type. (build_int_cst_type): Use double_int_to_tree and shwi_to_double_int instead of fit_double_type and build_int_cst_wide. * builtins.c (): Use double_int_fits_to_tree_p and double_int_to_tree instead of fit_double_type and build_int_cst_wide. (fold_builtin_object_size): Use double_int_fits_to_tree_p instead of fit_double_type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161847 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/double-int.c | 65 -------------------------------------------------------- 1 file changed, 65 deletions(-) (limited to 'gcc/double-int.c') diff --git a/gcc/double-int.c b/gcc/double-int.c index 0bfe514238d..924e91b6c90 100644 --- a/gcc/double-int.c +++ b/gcc/double-int.c @@ -69,71 +69,6 @@ decode (HOST_WIDE_INT *words, unsigned HOST_WIDE_INT *low, *hi = words[2] + words[3] * BASE; } -/* Force the double-word integer L1, H1 to be within the range of the - integer type TYPE. Stores the properly truncated and sign-extended - double-word integer in *LV, *HV. Returns true if the operation - overflows, that is, argument and result are different. */ - -int -fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, - unsigned HOST_WIDE_INT *lv, HOST_WIDE_INT *hv, const_tree type) -{ - unsigned HOST_WIDE_INT low0 = l1; - HOST_WIDE_INT high0 = h1; - unsigned int prec = TYPE_PRECISION (type); - int sign_extended_type; - - /* Size types *are* sign extended. */ - sign_extended_type = (!TYPE_UNSIGNED (type) - || (TREE_CODE (type) == INTEGER_TYPE - && TYPE_IS_SIZETYPE (type))); - - /* First clear all bits that are beyond the type's precision. */ - if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - ; - else if (prec > HOST_BITS_PER_WIDE_INT) - h1 &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); - else - { - h1 = 0; - if (prec < HOST_BITS_PER_WIDE_INT) - l1 &= ~((HOST_WIDE_INT) (-1) << prec); - } - - /* Then do sign extension if necessary. */ - if (!sign_extended_type) - /* No sign extension */; - else if (prec >= 2 * HOST_BITS_PER_WIDE_INT) - /* Correct width already. */; - else if (prec > HOST_BITS_PER_WIDE_INT) - { - /* Sign extend top half? */ - if (h1 & ((unsigned HOST_WIDE_INT)1 - << (prec - HOST_BITS_PER_WIDE_INT - 1))) - h1 |= (HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT); - } - else if (prec == HOST_BITS_PER_WIDE_INT) - { - if ((HOST_WIDE_INT)l1 < 0) - h1 = -1; - } - else - { - /* Sign extend bottom half? */ - if (l1 & ((unsigned HOST_WIDE_INT)1 << (prec - 1))) - { - h1 = -1; - l1 |= (HOST_WIDE_INT)(-1) << prec; - } - } - - *lv = l1; - *hv = h1; - - /* If the value didn't fit, signal overflow. */ - return l1 != low0 || h1 != high0; -} - /* Add two doubleword integers with doubleword result. Return nonzero if the operation overflows according to UNSIGNED_P. Each argument is given as two `HOST_WIDE_INT' pieces. -- cgit v1.2.1