Re: [hackers] [libgrapheme] Mark likely branches || Laslo Hunhold

2022-01-04 Thread Silvan Jegen
NRK wrote: > On Wed, Jan 05, 2022 at 01:56:26AM +0600, NRK wrote: > > Just curious, why not use: > > > > #if defined(__has_builtin) && __has_builtin(__builtin_expect) > > #define likely(expr) __builtin_expect(!!(expr), 1) > > #define unlikely(expr) __builtin_expect(!!(expr), 0) > > #else

Re: [hackers] [libgrapheme] Mark likely branches || Laslo Hunhold

2022-01-04 Thread NRK
On Wed, Jan 05, 2022 at 01:56:26AM +0600, NRK wrote: > Just curious, why not use: > > #if defined(__has_builtin) && __has_builtin(__builtin_expect) > #define likely(expr) __builtin_expect(!!(expr), 1) > #define unlikely(expr) __builtin_expect(!!(expr), 0) > #else > #define likely

Re: [hackers] [libgrapheme] Mark likely branches || Laslo Hunhold

2022-01-04 Thread NRK
> +#ifdef __has_builtin > + #if __has_builtin(__builtin_expect) > + #define likely(expr) __builtin_expect(!!(expr), 1) > + #define unlikely(expr) __builtin_expect(!!(expr), 0) > + #else > + #define likely(expr) (expr) > + #define unlikely(expr

[hackers] [libgrapheme] Mark likely branches || Laslo Hunhold

2022-01-04 Thread git
commit e917e53a05de7cab2591d6b2fa3f2ce5ece89bcf Author: Laslo Hunhold AuthorDate: Tue Jan 4 18:56:38 2022 +0100 Commit: Laslo Hunhold CommitDate: Tue Jan 4 18:56:38 2022 +0100 Mark likely branches The likely() and unlikely() macros (known from the Linux kernel) in src/ut

[hackers] [libgrapheme] Use "#ifdef" instead of "#if defined" || Laslo Hunhold

2022-01-04 Thread git
commit 10a95f711451bc653ba5d1f14c0f514e4d854c44 Author: Laslo Hunhold AuthorDate: Tue Jan 4 18:47:06 2022 +0100 Commit: Laslo Hunhold CommitDate: Tue Jan 4 18:47:06 2022 +0100 Use "#ifdef" instead of "#if defined" Signed-off-by: Laslo Hunhold diff --git a/benchmark/charact

[hackers] [libgrapheme] Add UTF-8 decoder benchmark || Laslo Hunhold

2022-01-04 Thread git
commit 06013743a38729c531a67a63bbfd55b50badddfe Author: Laslo Hunhold AuthorDate: Tue Jan 4 18:11:02 2022 +0100 Commit: Laslo Hunhold CommitDate: Tue Jan 4 18:37:33 2022 +0100 Add UTF-8 decoder benchmark Here we can also see the trouble with the custom types in libutf8proc.

[hackers] [libgrapheme] Generate separate utf8proc_int32_t buffer to preserve strict aliasing || Laslo Hunhold

2022-01-04 Thread git
commit 602ae9b2041df6c7e2b1d9f9da2b5ae57eb94b64 Author: Laslo Hunhold AuthorDate: Tue Jan 4 18:29:30 2022 +0100 Commit: Laslo Hunhold CommitDate: Tue Jan 4 18:33:00 2022 +0100 Generate separate utf8proc_int32_t buffer to preserve strict aliasing This clearly shows why it's n

[hackers] [libgrapheme] Generalize benchmark-function with payload-struct || Laslo Hunhold

2022-01-04 Thread git
commit e7b4a99ac11124212811a345563e65d199b1fb79 Author: Laslo Hunhold AuthorDate: Tue Jan 4 18:10:09 2022 +0100 Commit: Laslo Hunhold CommitDate: Tue Jan 4 18:10:09 2022 +0100 Generalize benchmark-function with payload-struct Signed-off-by: Laslo Hunhold diff --git a/bench