Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-21 Thread H.J. Lu
On Mon, Apr 21, 2025 at 6:34 PM Jan Hubicka wrote: > > > On Mon, Apr 21, 2025 at 7:24 AM H.J. Lu wrote: > > > > > > On Sun, Apr 20, 2025 at 6:31 PM Jan Hubicka wrote: > > > > > > > > > PR target/102294 > > > > > PR target/119596 > > > > > * config/i386/x86-tune-costs.h (generic

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-21 Thread Jan Hubicka
> On Mon, Apr 21, 2025 at 7:24 AM H.J. Lu wrote: > > > > On Sun, Apr 20, 2025 at 6:31 PM Jan Hubicka wrote: > > > > > > > PR target/102294 > > > > PR target/119596 > > > > * config/i386/x86-tune-costs.h (generic_memcpy): Updated. > > > > (generic_memset): Likewise. > > > >

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-20 Thread H.J. Lu
On Mon, Apr 21, 2025 at 7:24 AM H.J. Lu wrote: > > On Sun, Apr 20, 2025 at 6:31 PM Jan Hubicka wrote: > > > > > PR target/102294 > > > PR target/119596 > > > * config/i386/x86-tune-costs.h (generic_memcpy): Updated. > > > (generic_memset): Likewise. > > > (generic_co

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-20 Thread H.J. Lu
On Sun, Apr 20, 2025 at 6:31 PM Jan Hubicka wrote: > > > PR target/102294 > > PR target/119596 > > * config/i386/x86-tune-costs.h (generic_memcpy): Updated. > > (generic_memset): Likewise. > > (generic_cost): Change CLEAR_RATIO to 17. > > * config/i386/x86-tune.

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-20 Thread Jan Hubicka
> PR target/102294 > PR target/119596 > * config/i386/x86-tune-costs.h (generic_memcpy): Updated. > (generic_memset): Likewise. > (generic_cost): Change CLEAR_RATIO to 17. > * config/i386/x86-tune.def (X86_TUNE_PREFER_KNOWN_REP_MOVSB_STOSB): > Add m_GENERIC

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-20 Thread Jan Hubicka
> On Sun, Apr 20, 2025 at 4:19 AM Jan Hubicka wrote: > > > > > On Tue, Apr 8, 2025 at 3:52 AM H.J. Lu wrote: > > > > > > > > Simplify memcpy and memset inline strategies to avoid branches for > > > > -mtune=generic: > > > > > > > > 1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/ve

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-19 Thread H.J. Lu
On Sun, Apr 20, 2025 at 4:19 AM Jan Hubicka wrote: > > > On Tue, Apr 8, 2025 at 3:52 AM H.J. Lu wrote: > > > > > > Simplify memcpy and memset inline strategies to avoid branches for > > > -mtune=generic: > > > > > > 1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/vector > > >lo

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-19 Thread Jan Hubicka
> On Tue, Apr 8, 2025 at 3:52 AM H.J. Lu wrote: > > > > Simplify memcpy and memset inline strategies to avoid branches for > > -mtune=generic: > > > > 1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/vector > >load and store for up to 16 * 16 (256) bytes when the data size is > >

Re: [PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-17 Thread Hongtao Liu
On Tue, Apr 8, 2025 at 3:52 AM H.J. Lu wrote: > > Simplify memcpy and memset inline strategies to avoid branches for > -mtune=generic: > > 1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/vector >load and store for up to 16 * 16 (256) bytes when the data size is >fixed and kn

[PATCH v2] x86: Update memcpy/memset inline strategies for -mtune=generic

2025-04-07 Thread H.J. Lu
Simplify memcpy and memset inline strategies to avoid branches for -mtune=generic: 1. With MOVE_RATIO and CLEAR_RATIO == 17, GCC will use integer/vector load and store for up to 16 * 16 (256) bytes when the data size is fixed and known. 2. Inline only if data size is known to be <= 256. a