Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-06-12 Thread Tejas Belagod via Gcc-patches
From: Richard Sandiford Date: Friday, May 19, 2023 at 3:20 PM To: Tejas Belagod Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab] Tejas Belagod writes: > Am I correct to understand that we still need to check for the case when > there's a repeati

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-19 Thread Richard Sandiford via Gcc-patches
Tejas Belagod writes: > Am I correct to understand that we still need to check for the case when > there's a repeating non-zero elements in the case of NELTS_PER_PATTERN == 2? > eg. { 0, 0, 1, 1, 1, 1,} which should be encoded as {0, 0, 1, 1} with > NPATTERNS = 2 ? Yeah, that's right. The

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-19 Thread Tejas Belagod via Gcc-patches
From: Richard Sandiford Date: Tuesday, May 16, 2023 at 5:36 PM To: Tejas Belagod Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab] Tejas Belagod writes: >>> + { >>> + b = build3 (BIT_FIELD_REF, TREE

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-16 Thread Richard Sandiford via Gcc-patches
Tejas Belagod writes: >>> + { >>> + b = build3 (BIT_FIELD_REF, TREE_TYPE (f.lhs), val, >>> + bitsize_int (step * BITS_PER_UNIT), >>> + bitsize_int ((16 - step) * BITS_PER_UNIT)); >>> + >>> + return gimple_build_assign (f.lhs, b); >>> +

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-16 Thread Tejas Belagod via Gcc-patches
From: Richard Sandiford Date: Tuesday, May 16, 2023 at 2:15 PM To: Tejas Belagod Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab] Tejas Belagod writes: >> + { >> +int i; >> +int nelts = vector_cst_encoded_nelts (v); >&g

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-16 Thread Richard Sandiford via Gcc-patches
Tejas Belagod writes: >> + { >> +int i; >> +int nelts = vector_cst_encoded_nelts (v); >> +int first_el = 0; >> + >> +for (i = first_el; i < nelts; i += step) >> + if (VECTOR_CST_ENCODED_ELT (v, i) != VECTOR_CST_ENCODED_ELT (v, > first_el)) > > I think this should use

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-16 Thread Tejas Belagod via Gcc-patches
Thanks for your comments, Richard. From: Richard Sandiford Date: Friday, May 12, 2023 at 1:02 AM To: Tejas Belagod Cc: gcc-patches@gcc.gnu.org , Tejas Belagod Subject: Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab] Tejas Belagod writes: > From: Tejas Belagod > > This PR

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-11 Thread Richard Sandiford via Gcc-patches
Tejas Belagod writes: > From: Tejas Belagod > > This PR optimizes an SVE intrinsics sequence where > svlasta (svptrue_pat_b8 (SV_VL1), x) > a scalar is selected based on a constant predicate and a variable vector. > This sequence is optimized to return the correspoding element of a

Re: [PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-05-03 Thread Tejas Belagod via Gcc-patches
[Ping] From: Tejas Belagod Date: Thursday, March 16, 2023 at 5:09 PM To: gcc-patches@gcc.gnu.org Cc: Tejas Belagod , Richard Sandiford Subject: [PATCH] [PR96339] AArch64: Optimise svlast[ab] From: Tejas Belagod This PR optimizes an SVE intrinsics sequence where svlasta (svptrue_pat_b8

[PATCH] [PR96339] AArch64: Optimise svlast[ab]

2023-03-16 Thread Tejas Belagod via Gcc-patches
From: Tejas Belagod This PR optimizes an SVE intrinsics sequence where svlasta (svptrue_pat_b8 (SV_VL1), x) a scalar is selected based on a constant predicate and a variable vector. This sequence is optimized to return the correspoding element of a NEON vector. For eg. svlasta