This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Changes to the wide-int classes
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: gcc-patches at gcc dot gnu dot org, mikestump at comcast dot net, rguenther at suse dot de
- Date: Mon, 02 Sep 2013 10:10:25 +0100
- Subject: Re: [RFC] Changes to the wide-int classes
- Authentication-results: sourceware.org; auth=none
- References: <87wqn0bb5q dot fsf at talisman dot default> <5223F9D7 dot 1030307 at naturalbridge dot com>
Kenneth Zadeck <email@example.com> writes:
> There is no place for exactly two HWIs in the machine independent parts
> of the compiler,
I totally agree. In fact I was taking that so much for granted that
I didn't even think to add a rider about it, sorry. I didn't mean
to imply that we should keep double_int around.
I think the reason for doing this is to prove that it can be done
(so that the wide_int code isn't too big a change for the tree level)
and to make it easier to merge the wide-int patches into trunk piecemeal
if we need to.
> ==== small bugs below this line.
> bottom of frag 3 of gcc/cp/init.c is wrong: you replaced
> rshift...lshift with lshift...lshift.
Do you mean this bit:
unsigned shift = (max_outer_nelts.get_precision ()) - 7
- - max_outer_nelts.clz ().to_shwi ();
- max_outer_nelts = max_outer_nelts.rshiftu (shift).lshift (shift);
+ - wi::clz (max_outer_nelts);
+ max_outer_nelts = wi::lshift (wi::lrshift (max_outer_nelts, shift),
? That's lrshift (logical right shift). I ended up using the double-int
names for right shifts.
That does remind me of another thing though. I notice some of the wide-int
code assumes that shifting a signed HWI right gives an arithmetic shift,
but the language doesn't guarantee that. We probably need to go through
and fix those.
> i will finish reading this tomorrow, but i wanted to get some comments
> in for the early shift. i stopped reading at line 1275.
Thanks. TBH I've not really been through the third part myself to
double-check. Will try to do that while waiting for comments on the