Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-20 Thread Kito Cheng via Gcc-patches
> > I would like to have a unified option interface, > > maybe -m[no-]inline-str[n]cmp and -minline-str[n]cmp-limit. > > For the basic option (-m[no-]inline-str[n]cmp), I would punt to > -fno-builtin-str[n]cmp. -fno-bulitin-* will also suppress middle-end optimization for those builtins. see:

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-15 Thread Philipp Tomsich
On Tue, 15 Nov 2022 at 01:46, Kito Cheng wrote: > > Hi Christoph: > > > This patch implements expansions for the cmpstrsi and the cmpstrnsi > > builtins using Zbb instructions (if available). > > This allows to inline calls to strcmp() and strncmp(). > > > > The expansion basically emits a peeled

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-15 Thread Christoph Müllner
On Tue, Nov 15, 2022 at 1:46 AM Kito Cheng wrote: > Hi Christoph: > > > This patch implements expansions for the cmpstrsi and the cmpstrnsi > > builtins using Zbb instructions (if available). > > This allows to inline calls to strcmp() and strncmp(). > > > > The expansion basically emits a

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Jeff Law via Gcc-patches
On 11/14/22 17:53, Palmer Dabbelt wrote: On Mon, 14 Nov 2022 16:46:37 PST (-0800), Kito Cheng wrote: Hi Christoph: This patch implements expansions for the cmpstrsi and the cmpstrnsi builtins using Zbb instructions (if available). This allows to inline calls to strcmp() and strncmp(). The

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Kito Cheng
On Tue, Nov 15, 2022 at 8:53 AM Palmer Dabbelt wrote: > > On Mon, 14 Nov 2022 16:46:37 PST (-0800), Kito Cheng wrote: > > Hi Christoph: > > > >> This patch implements expansions for the cmpstrsi and the cmpstrnsi > >> builtins using Zbb instructions (if available). > >> This allows to inline

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Palmer Dabbelt
On Mon, 14 Nov 2022 16:46:37 PST (-0800), Kito Cheng wrote: Hi Christoph: This patch implements expansions for the cmpstrsi and the cmpstrnsi builtins using Zbb instructions (if available). This allows to inline calls to strcmp() and strncmp(). The expansion basically emits a peeled

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Kito Cheng via Gcc-patches
Hi Christoph: > This patch implements expansions for the cmpstrsi and the cmpstrnsi > builtins using Zbb instructions (if available). > This allows to inline calls to strcmp() and strncmp(). > > The expansion basically emits a peeled comparison sequence (i.e. a peeled > comparison loop) which

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Jeff Law via Gcc-patches
On 11/14/22 14:49, Christoph Müllner wrote: We can take this further, but then the following questions pop up: * how much data processing per loop iteration? I have no idea because I don't have any real data.  Last time I gathered any data on this issue was circa 1988 :-) * what about

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Christoph Müllner
On Mon, Nov 14, 2022 at 8:28 PM Jeff Law wrote: > > On 11/13/22 16:05, Christoph Muellner wrote: > > From: Christoph Müllner > > > > This patch implements expansions for the cmpstrsi and the cmpstrnsi > > builtins using Zbb instructions (if available). > > This allows to inline calls to

Re: [PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-14 Thread Jeff Law via Gcc-patches
On 11/13/22 16:05, Christoph Muellner wrote: From: Christoph Müllner This patch implements expansions for the cmpstrsi and the cmpstrnsi builtins using Zbb instructions (if available). This allows to inline calls to strcmp() and strncmp(). The expansion basically emits a peeled comparison

[PATCH 7/7] riscv: Add support for str(n)cmp inline expansion

2022-11-13 Thread Christoph Muellner
From: Christoph Müllner This patch implements expansions for the cmpstrsi and the cmpstrnsi builtins using Zbb instructions (if available). This allows to inline calls to strcmp() and strncmp(). The expansion basically emits a peeled comparison sequence (i.e. a peeled comparison loop) which