Re: Peephole optimisation: isWhitespace()

2020-08-25 Thread Stefan Kanthak
I wrote: > "Richard Biener" wrote: [...] >> Whether or not the branch is predicted taken does not matter, what >> matters is that the continuation is not data dependent on the branch >> target computation and thus can execute in parallel to it. > > My benchmark shows that this doesn't

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Stefan Kanthak
"Richard Biener" wrote: > On Mon, Aug 24, 2020 at 1:22 PM Stefan Kanthak > wrote: >> >> "Richard Biener" wrote: >> >> > On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak >> > wrote: >> >> >> >> "Allan Sandfeld Jensen" wrote: >> >> >> >> > On Freitag, 14. August 2020 18:43:12 CEST Stefan

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Richard Biener via Gcc
On Mon, Aug 24, 2020 at 1:22 PM Stefan Kanthak wrote: > > "Richard Biener" wrote: > > > On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak > > wrote: > >> > >> "Allan Sandfeld Jensen" wrote: > >> > >> > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: > >> >> Hi @ll, > >> >> > >>

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Stefan Kanthak
"Richard Biener" wrote: > On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak > wrote: >> >> "Allan Sandfeld Jensen" wrote: >> >> > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: >> >> Hi @ll, >> >> >> >> in his ACM queue article , >>

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Alexander Monakov via Gcc
On Mon, 24 Aug 2020, Richard Biener via Gcc wrote: > Whether or not the conditional branch sequence is faster depends on whether > the branch is well-predicted which very much depends on the data you > feed the isWhitespace function with but I guess since this is the > c == ' ' test it _will_ be

Re: Peephole optimisation: isWhitespace()

2020-08-24 Thread Richard Biener via Gcc
On Mon, Aug 17, 2020 at 7:09 PM Stefan Kanthak wrote: > > "Allan Sandfeld Jensen" wrote: > > > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: > >> Hi @ll, > >> > >> in his ACM queue article , > >> Matt Godbolt used the function > >> >

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Stefan Kanthak
"Allan Sandfeld Jensen" wrote: > On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: >> Hi @ll, >> >> in his ACM queue article , >> Matt Godbolt used the function >> >> | bool isWhitespace(char c) >> | { >> | >> | return c == ' ' >>

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Allan Sandfeld Jensen
On Freitag, 14. August 2020 18:43:12 CEST Stefan Kanthak wrote: > Hi @ll, > > in his ACM queue article , > Matt Godbolt used the function > > | bool isWhitespace(char c) > | { > | > | return c == ' ' > | > | || c == '\r' > | || c

Re: Peephole optimisation: isWhitespace()

2020-08-17 Thread Stefan Kanthak
"Nathan Sidwell" > On 8/16/20 9:54 AM, Stefan Kanthak wrote: >> "Nathan Sidwell" wrote: [...] >>> Have you benchmarked it? >> >> Of course! Did you? [...] > you seem very angry about being asked for data. As much as you hallucinated about CMOV or processors not speculating beyond SETNZ?

Re: Peephole optimisation: isWhitespace()

2020-08-16 Thread Nathan Sidwell
On 8/16/20 9:54 AM, Stefan Kanthak wrote: "Nathan Sidwell" wrote: What evidence do you have that your alternative sequence performs better? 45+ years experience in writing assembly code! Have you benchmarked it? Of course! Did you? I didn't include the numbers in my initial post

Re: Peephole optimisation: isWhitespace()

2020-08-16 Thread Stefan Kanthak
"Nathan Sidwell" wrote: > On 8/14/20 12:43 PM, Stefan Kanthak wrote: >> Hi @ll, >> >> in his ACM queue article , >> Matt Godbolt used the function >> >> | bool isWhitespace(char c) >> | { >> | return c == ' ' >> | || c == '\r' >> |

Re: Peephole optimisation: isWhitespace()

2020-08-15 Thread Nathan Sidwell
On 8/14/20 12:43 PM, Stefan Kanthak wrote: Hi @ll, in his ACM queue article , Matt Godbolt used the function | bool isWhitespace(char c) | { | return c == ' ' | || c == '\r' | || c == '\n' | || c == '\t'; | } as an example,

Peephole optimisation: isWhitespace()

2020-08-14 Thread Stefan Kanthak
Hi @ll, in his ACM queue article , Matt Godbolt used the function | bool isWhitespace(char c) | { | return c == ' ' | || c == '\r' | || c == '\n' | || c == '\t'; | } as an example, for which GCC 9.1 emits the following assembly