GCC plays "Shell Game", but looses track of the shell covering the nought

2023-05-27 Thread Stefan Kanthak
--- 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

Re: GCC plays "Shell Game", but looses track of the shell covering the nought

2023-05-27 Thread Stefan Kanthak
"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

Epic code generator/optimiser failures

2023-05-27 Thread Stefan Kanthak
--- 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

Will GCC eventually support correct code compilation?

2023-05-27 Thread Dave Blanchard
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/

Will GCC eventually support correct code compilation?

2023-05-27 Thread Dave Blanchard
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

Re: Will GCC eventually support SSE2 or SSE4.1?

2023-05-27 Thread LIU Hao via Gcc
在 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

Re: Will GCC eventually support SSE2 or SSE4.1?

2023-05-27 Thread Stefan Kanthak
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

Re: Will GCC eventually support correct code compilation?

2023-05-27 Thread Jason Merrill via Gcc
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

Another epic optimiser failure

2023-05-27 Thread Stefan Kanthak
--- .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

Re: Another epic optimiser failure

2023-05-27 Thread Jakub Jelinek via Gcc
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.

Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Stefan Kanthak
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

Re: Another epic optimiser failure

2023-05-27 Thread Stefan Kanthak
"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

Re: Another epic optimiser failure

2023-05-27 Thread Andrew Pinski via Gcc
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

Re: Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Andrew Pinski via Gcc
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;

Re: Another epic optimiser failure

2023-05-27 Thread Stefan Kanthak
"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

gcc-13-20230527 is now available

2023-05-27 Thread GCC Administrator via Gcc
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

Re: Another epic optimiser failure

2023-05-27 Thread Jonathan Wakely via Gcc
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

Re: Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Stefan Kanthak
"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

Re: Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Mark Wielaard
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

Re: Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Andrew Pinski via Gcc
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

Re: Another epic optimiser failure

2023-05-27 Thread Nicholas Vinson via Gcc
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

Re: Who cares about performance (or Intel's CPU errata)?

2023-05-27 Thread Nicholas Vinson via Gcc
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