This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: Use ULL on big hexadecimal literal
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: gcc-patches at gcc dot gnu dot org, dje dot gcc at gmail dot com
- Date: Wed, 13 Nov 2019 04:52:06 -0600
- Subject: Re: [PATCH] rs6000: Use ULL on big hexadecimal literal
- References: <3947efe80d59f015d282c294a87cdb49b1bdeb08.1573595033.git.segher@kernel.crashing.org> <14074b05-e756-c527-12a2-e7a0df8a40d6@twiddle.net>
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