--- demo.c ---
int ispowerof2(unsigned long long argument) {
return (argument != 0) && ((argument & argument - 1) == 0);
}
--- EOF ---
GCC 12.2gcc -m32 -O3
https://gcc.godbolt.org/z/YWP4zb8jd
ispowerof2(unsigned long long):
pushedi# three registers clob
"Dave Blanchard" wrote:
> Hi Stefan, thanks for sharing this information.
> I was wondering if the code generators in earlier GCC
> versions were any better?
Just open one of the URLs I included, select another GCC version
and see the resulting code.
> Is this a problem in GCC 12+ only?
NO! GC
--- demo.c ---
int ispowerof2(unsigned long long argument) {
return (argument != 0) && ((argument & argument - 1) == 0);
}
--- EOF ---
GCC 13.1gcc -m32 -mavx -O3 # or -march=native instead of -mavx
https://gcc.godbolt.org/z/T31Gzo85W
ispowerof2(unsigned long long):
vmovq xmm1, Q
On Fri, 26 May 2023 18:44:41 +0200
David Brown via Gcc wrote:
> On 26/05/2023 17:49, Stefan Kanthak wrote:
>
> > I don't like to argue with idiots: they beat me with experience!
> >
> > Stefan
> >
>
> Stefan, you are clearly not happy about the /free/ compiler you are
> using, and its /free/
On Fri, 26 May 2023 18:44:41 +0200
David Brown via Gcc wrote:
> On 26/05/2023 17:49, Stefan Kanthak wrote:
>
> > I don't like to argue with idiots: they beat me with experience!
> >
> > Stefan
> >
>
> Stefan, you are clearly not happy about the /free/ compiler you are
> using, and its /fre
在 2023-05-26 23:40, Stefan Kanthak 写道:
Feel free to propose this alternative here (better elsewhere, where you'll
earn less laughter).
But don't forget that this 23-bit mantissa will be all zeroes for quite some
64-bit (and even 32-bit) integers which are no power of 2, for example
0x803f
You wrote:
>在 2023-05-26 23:40, Stefan Kanthak 写道:
>> Feel free to propose this alternative here (better elsewhere, where you'll
>> earn less laughter).
>> But don't forget that this 23-bit mantissa will be all zeroes for quite some
>> 64-bit (and even 32-bit) integers which are no power of 2, for
On Sat, May 27, 2023 at 2:15 PM Dave Blanchard wrote:
> If nobody wants to have detailed discussions about the technical workings
> of a very serious tool that millions are relying on day in and day out,
> what is this mailing list FOR, exactly?
>
For discussions, absolutely. Not for Usenet-sty
--- .c ---
int ispowerof2(unsigned long long argument) {
return __builtin_popcountll(argument) == 1;
}
--- EOF ---
GCC 13.3gcc -m32 -march=alderlake -O3
gcc -m32 -march=sapphirerapids -O3
gcc -m32 -mpopcnt -mtune=sapphirerapids -O3
https://gcc.godbolt.org/z/cToYrrY
On Sat, May 27, 2023 at 11:04:11PM +0200, Stefan Kanthak wrote:
> OUCH: popcnt writes the WHOLE result register, there is ABSOLUTELY
> no need to clear it beforehand nor to clear the higher 24 bits
> afterwards!
Except that there is. See https://gcc.gnu.org/PR62011 for details.
Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers are:
--- dontcare.c ---
int ispowerof2(unsigned __int128 argument) {
return __builtin_popcountll(argument) + __builtin_popcountll(argument >>
64) == 1;
}
--- EOF ---
GCC 13.3gcc -march=haswell -O3
https://gcc.godb
"Jakub Jelinek" wrote, completely clueless:
> On Sat, May 27, 2023 at 11:04:11PM +0200, Stefan Kanthak wrote:
>> OUCH: popcnt writes the WHOLE result register, there is ABSOLUTELY
>> no need to clear it beforehand nor to clear the higher 24 bits
>> afterwards!
>
> Except that there i
On Sat, May 27, 2023 at 2:38 PM Stefan Kanthak wrote:
>
> "Jakub Jelinek" wrote, completely clueless:
>
> > On Sat, May 27, 2023 at 11:04:11PM +0200, Stefan Kanthak wrote:
> >> OUCH: popcnt writes the WHOLE result register, there is ABSOLUTELY
> >> no need to clear it beforehand nor to clea
On Sat, May 27, 2023 at 2:25 PM Stefan Kanthak wrote:
>
> Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers are:
>
> --- dontcare.c ---
> int ispowerof2(unsigned __int128 argument) {
> return __builtin_popcountll(argument) + __builtin_popcountll(argument >>
> 64) == 1;
"Andrew Pinski" wrote:
> On Sat, May 27, 2023 at 2:38 PM Stefan Kanthak
> wrote:
>>
>> "Jakub Jelinek" wrote, completely clueless:
>>
>>> On Sat, May 27, 2023 at 11:04:11PM +0200, Stefan Kanthak wrote:
OUCH: popcnt writes the WHOLE result register, there is ABSOLUTELY
no need t
Snapshot gcc-13-20230527 is now available on
https://gcc.gnu.org/pub/gcc/snapshots/13-20230527/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
This snapshot has been generated from the GCC 13 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch
On Sat, 27 May 2023 at 23:03, Stefan Kanthak wrote:
>
> "Andrew Pinski" wrote:
>
> > On Sat, May 27, 2023 at 2:38 PM Stefan Kanthak
> > wrote:
> >>
> >> "Jakub Jelinek" wrote, completely clueless:
> >>
> >>> On Sat, May 27, 2023 at 11:04:11PM +0200, Stefan Kanthak wrote:
> OUCH: popcnt wr
"Andrew Pinski" wrote:
> On Sat, May 27, 2023 at 2:25 PM Stefan Kanthak
> wrote:
>>
>> Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers
>> are:
>>
>> --- dontcare.c ---
>> int ispowerof2(unsigned __int128 argument) {
>> return __builtin_popcountll(argument) + __bui
Hi Stefan,
On Sun, May 28, 2023 at 12:52:30AM +0200, Stefan Kanthak wrote:
> >> Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers
> >> are:
This is totally not constructive. You should stop attacking others
like that on this list.
> OUCH, my fault; sorry for the confusio
On Sat, May 27, 2023 at 3:54 PM Stefan Kanthak wrote:
>
> "Andrew Pinski" wrote:
>
> > On Sat, May 27, 2023 at 2:25 PM Stefan Kanthak
> > wrote:
> >>
> >> Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers
> >> are:
> >>
> >> --- dontcare.c ---
> >> int ispowerof2(unsign
On 5/27/23 17:04, Stefan Kanthak wrote:
--- .c ---
int ispowerof2(unsigned long long argument) {
return __builtin_popcountll(argument) == 1;
}
--- EOF ---
GCC 13.3gcc -m32 -march=alderlake -O3
gcc -m32 -march=sapphirerapids -O3
gcc -m32 -mpopcnt -mtune=sapphi
On 5/27/23 18:52, Stefan Kanthak wrote:
"Andrew Pinski" wrote:
On Sat, May 27, 2023 at 2:25 PM Stefan Kanthak wrote:
Just to show how SLOPPY, INCONSEQUENTIAL and INCOMPETENT GCC's developers are:
--- dontcare.c ---
int ispowerof2(unsigned __int128 argument) {
return __builtin_popcoun
22 matches
Mail list logo