Message ID | 87ppns5h7j.fsf@sandifor-thinkpad.stglab.manchester.uk.ibm.com |
---|---|
State | New |
Headers | show |
On Jan 16, 2014, at 2:55 AM, Richard Sandiford <rsandifo@linux.vnet.ibm.com> wrote: >>> Why did you need the <real_int>? It was supposed to work without. >> >> The code in question needs something that is max int + max significand >> real in size, we made the max int smaller (smaller than this quantity on >> x86) so, this code needs a special wide int that is bigger. The type is >> free as vrp uses the same type. As for why Kenny choose this method, >> I'd defer to him. > > To be clear, I was only talking about the <real_int> in > "wi::lrshift<real_int>". Just "wi::lrshift" should be fine. > > Tested on x86_64-linux-gnu. OK to install? Ah, yes, I was trying to get it to compile at one point and added that; I now see what you mean. Yes, this is fine. > Index: gcc/real.c > =================================================================== > --- gcc/real.c 2014-01-15 16:39:39.883276568 +0000 > +++ gcc/real.c 2014-01-15 16:39:40.376274546 +0000 > @@ -1444,7 +1444,7 @@ real_to_integer (const REAL_VALUE_TYPE * > w = SIGSZ * HOST_BITS_PER_LONG + words * HOST_BITS_PER_WIDE_INT; > tmp = real_int::from_array > (val, (w + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT, w); > - tmp = wi::lrshift<real_int> (tmp, (words * HOST_BITS_PER_WIDE_INT) - exp); > + tmp = wi::lrshift (tmp, (words * HOST_BITS_PER_WIDE_INT) - exp); > result = wide_int::from (tmp, precision, UNSIGNED); > > if (r->sign)
Index: gcc/expmed.c =================================================================== --- gcc/expmed.c 2014-01-15 16:39:39.881276576 +0000 +++ gcc/expmed.c 2014-01-15 16:39:40.375274550 +0000 @@ -4963,7 +4963,7 @@ make_tree (tree type, rtx x) return t; case CONST_DOUBLE: - gcc_assert (HOST_BITS_PER_WIDE_INT * 2 <= MAX_BITSIZE_MODE_ANY_INT); + STATIC_ASSERT (HOST_BITS_PER_WIDE_INT * 2 <= MAX_BITSIZE_MODE_ANY_INT); if (TARGET_SUPPORTS_WIDE_INT == 0 && GET_MODE (x) == VOIDmode) t = wide_int_to_tree (type, wide_int::from_array (&CONST_DOUBLE_LOW (x), 2, Index: gcc/real.c =================================================================== --- gcc/real.c 2014-01-15 16:39:39.883276568 +0000 +++ gcc/real.c 2014-01-15 16:39:40.376274546 +0000 @@ -1444,7 +1444,7 @@ real_to_integer (const REAL_VALUE_TYPE * w = SIGSZ * HOST_BITS_PER_LONG + words * HOST_BITS_PER_WIDE_INT; tmp = real_int::from_array (val, (w + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT, w); - tmp = wi::lrshift<real_int> (tmp, (words * HOST_BITS_PER_WIDE_INT) - exp); + tmp = wi::lrshift (tmp, (words * HOST_BITS_PER_WIDE_INT) - exp); result = wide_int::from (tmp, precision, UNSIGNED); if (r->sign)