Re: [PATCH] rs6000: Use ULL on big hexadecimal literal

2019-11-18 Thread Segher Boessenkool
On Tue, Nov 12, 2019 at 09:52:43PM +, Segher Boessenkool wrote:
> C++98 does not have long long int, and does not use (unsigned) long
> long int for hexadecimal literals.  So let's use an ULL suffix here,
> which is still not strict C++98, but which works with more compilers.
> 
> Tested etc.; committing to trunk.

I backported this to GCC 9 branch now.


Segher


> 2019-11-12  Segher Boessenkool  
> 
>   * config/rs6000/rs6000.md (rs6000_set_fpscr_drn): Use ULL on big
>   hexadecimal literal.


Re: [PATCH] rs6000: Use ULL on big hexadecimal literal

2019-11-13 Thread Segher Boessenkool
On Wed, Nov 13, 2019 at 09:15:38AM +0100, Richard Henderson wrote:
> On 11/12/19 10:52 PM, Segher Boessenkool wrote:
> > C++98 does not have long long int, and does not use (unsigned) long
> > long int for hexadecimal literals.  So let's use an ULL suffix here,
> > which is still not strict C++98, but which works with more compilers.
> 
> Isn't that what HOST_WIDE_INT_UC() is for?
> Of course, that will use either UL or ULL itself...

HOST_WIDE_INT_UC doesn't exactly make the code more readable, IMO.

It is passed here directly to GEN_INT, so as long as the suffix makes it
a big enough type all is well.  There are many occurrences of this in
the tree already, including another in this same file.

Soon we will require C++11 and we won't need any suffixes on hexadecimal
literals anymore, in all common cases (all sane cases one could say).
So we don't have to discuss this anymore :-)


Segher