Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-07 Thread Richard Biener
On Fri, Oct 4, 2024 at 3:07 PM Jonathan Wakely wrote: > > On Fri, 4 Oct 2024 at 13:53, Dmitry Ilvokhin wrote: > > > > On Fri, Oct 04, 2024 at 10:20:27AM +0100, Jonathan Wakely wrote: > > > On Fri, 4 Oct 2024 at 10:19, Jonathan Wakely wrote: > > > > > > > > On Fri, 4 Oct 2024 at 07:53, Richard Bi

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-04 Thread Jonathan Wakely
On Fri, 4 Oct 2024 at 13:53, Dmitry Ilvokhin wrote: > > On Fri, Oct 04, 2024 at 10:20:27AM +0100, Jonathan Wakely wrote: > > On Fri, 4 Oct 2024 at 10:19, Jonathan Wakely wrote: > > > > > > On Fri, 4 Oct 2024 at 07:53, Richard Biener > > > wrote: > > > > > > > > On Wed, Oct 2, 2024 at 8:26 PM Jo

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-04 Thread Dmitry Ilvokhin
On Fri, Oct 04, 2024 at 10:20:27AM +0100, Jonathan Wakely wrote: > On Fri, 4 Oct 2024 at 10:19, Jonathan Wakely wrote: > > > > On Fri, 4 Oct 2024 at 07:53, Richard Biener > > wrote: > > > > > > On Wed, Oct 2, 2024 at 8:26 PM Jonathan Wakely wrote: > > > > > > > > On Wed, 2 Oct 2024 at 19:16, Jo

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-04 Thread Richard Biener
On Fri, Oct 4, 2024 at 11:20 AM Jonathan Wakely wrote: > > On Fri, 4 Oct 2024 at 10:19, Jonathan Wakely wrote: > > > > On Fri, 4 Oct 2024 at 07:53, Richard Biener > > wrote: > > > > > > On Wed, Oct 2, 2024 at 8:26 PM Jonathan Wakely wrote: > > > > > > > > On Wed, 2 Oct 2024 at 19:16, Jonathan

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-04 Thread Jonathan Wakely
On Fri, 4 Oct 2024 at 10:19, Jonathan Wakely wrote: > > On Fri, 4 Oct 2024 at 07:53, Richard Biener > wrote: > > > > On Wed, Oct 2, 2024 at 8:26 PM Jonathan Wakely wrote: > > > > > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhi

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-04 Thread Jonathan Wakely
On Fri, 4 Oct 2024 at 07:53, Richard Biener wrote: > > On Wed, Oct 2, 2024 at 8:26 PM Jonathan Wakely wrote: > > > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > > > > > Instead of looping over every byte of the tail

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-03 Thread Richard Biener
On Wed, Oct 2, 2024 at 8:26 PM Jonathan Wakely wrote: > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > > > Instead of looping over every byte of the tail, unroll loop manually > > > using switch statement, then compilers

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-03 Thread Dmitry Ilvokhin
On Wed, Oct 02, 2024 at 08:15:38PM +0100, Jonathan Wakely wrote: > On Wed, 2 Oct 2024 at 19:25, Jonathan Wakely wrote: > > > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > > > > > Instead of looping over every byte of

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:25, Jonathan Wakely wrote: > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > > > Instead of looping over every byte of the tail, unroll loop manually > > > using switch statement, then compilers (a

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > Instead of looping over every byte of the tail, unroll loop manually > > using switch statement, then compilers (at least GCC and Clang) will > > generate a jump table [1], which is

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > Instead of looping over every byte of the tail, unroll loop manually > using switch statement, then compilers (at least GCC and Clang) will > generate a jump table [1], which is faster on a microbenchmark [2]. > > [1]: https://godbolt.org/z/a

[PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Dmitry Ilvokhin
Instead of looping over every byte of the tail, unroll loop manually using switch statement, then compilers (at least GCC and Clang) will generate a jump table [1], which is faster on a microbenchmark [2]. [1]: https://godbolt.org/z/aE8Mq3j5G [2]: https://quick-bench.com/q/ylYLW2R22AZKRvameYYtbYxa