Jakub Jelinek <ja...@redhat.com> writes: > On Sat, Jan 30, 2016 at 02:04:45PM +0000, Richard Sandiford wrote: >> Not sure what to call it. Maybe canonize_uhwi? Like canonize, except >> that it takes a uhwi instead of a length. >> >> > Can that be done as a follow-up? Certainly it would need >> > to take the uhwi to store, pointer to the array of hwis, and precision. >> >> Yeah, guess it can wait. > > So like this? > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2016-02-01 Jakub Jelinek <ja...@redhat.com> > > * wide-int.cc (canonize_uhwi): New function. > (wi::divmod_internal): Use it. > > --- gcc/wide-int.cc.jj 2016-01-30 19:03:35.000000000 +0100 > +++ gcc/wide-int.cc 2016-02-01 12:28:23.501519292 +0100 > @@ -118,6 +118,20 @@ canonize (HOST_WIDE_INT *val, unsigned i > return 1; > } > > +/* VAL[0] is unsigned result of operation. Canonize it by adding > + another 0 block if needed, and return number of blocks needed. */ > + > +static inline unsigned int > +canonize_uhwi (HOST_WIDE_INT *val, unsigned int precision)
s/is unsigned result of operation/is the unsigned result of an operation/ LGTM otherwise, thanks. Richard