Re: [PATCH 01] aarch64: Changed CRC test.

2025-03-30 Thread Mariam Arutunian
Thank you too. On Sun, Mar 30, 2025, 19:34 Jeff Law wrote: > > > On 3/26/25 6:15 AM, Mariam Arutunian wrote: > > Fixed the iteration number in crc-crc32c-data16.c test from 8 to 16 to > > match the test name. > Thanks. I pushed this to the trunk. > > jeff >

Re: [PATCH] aarch64: change another CRC test

2025-03-30 Thread Mariam Arutunian
Yes, thank you! On Sun, Mar 30, 2025, 19:40 Sam James wrote: > Fixed the iteration number in crc-crc32-data16.c test from 8 to 16 to > match the test name, just like in r15-9038-gdf55a933cfc675. > > gcc/testsuite/ChangeLog: > * gcc.target/aarch64/crc-crc32-data16.c: Fix iteration >

[PATCH 01] aarch64: Changed CRC test.

2025-03-26 Thread Mariam Arutunian
Fixed the iteration number in crc-crc32c-data16.c test from 8 to 16 to match the test name. From d5f5bab516e45da6fa8a65dac106add2b4e4602f Mon Sep 17 00:00:00 2001 From: Mariam Arutunian Date: Wed, 26 Mar 2025 16:03:54 +0400 Subject: [PATCH] Fixed the iteration number in crc-crc32c-data16.c test

Re: [PATCH 0/5] LoongArch: CRC optimization

2024-12-16 Thread Mariam Arutunian
On Mon, Dec 16, 2024 at 5:20 PM Xi Ruoyao wrote: > A generic CRC optimization pass has been implemented in r15-5850. But > without target-specific code, it'll only optimize the CRC loop to a > table lookup. With LoongArch-specific code we can do it better: for > 64-bit LoongArch and the IEEE 80

Re: [RFC/RFA][PATCH v7 00/12] CRC optimization.

2024-12-09 Thread Mariam Arutunian
Thank you all very much for your help! ) Mariam On Tue, Dec 10, 2024, 04:04 Jeff Law wrote: > > > On 12/9/24 3:43 PM, Richard Sandiford wrote: > > >> Thanks. I was just about to reach out to confirm we're OK on aarch64. > >> I was going to run everything through one of the cfarm machines or >

Re: [RFC/RFA][PATCH v6 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-11-24 Thread Mariam Arutunian
On Sun, Nov 24, 2024, 08:59 Jeff Law wrote: > > > On 11/13/24 7:16 AM, Mariam Arutunian wrote: > > > > > > > To address this, I added code in |target-supports.exp| and modified the > > relevant tests. > > I've attached the patch. Could you please

Re: [RFC/RFA][PATCH v6 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-11-22 Thread Mariam Arutunian
On Fri, Nov 22, 2024, 20:29 Jeff Law wrote: > > > On 11/13/24 7:16 AM, Mariam Arutunian wrote: > > > > > > On Tue, Nov 12, 2024 at 2:15 AM Jeff Law > <mailto:jeffreya...@gmail.com>> wrote: > > > > > > > \ No newline at end of fil

Re: [RFC/RFA][PATCH v6 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-11-13 Thread Mariam Arutunian
On Tue, Nov 12, 2024 at 2:15 AM Jeff Law wrote: > > + > > + > > +/* Generate assembly to calculate CRC using clmul instruction. > > + The following code will be generated when the CRC and data sizes are > equal: > > + li a4,quotient > > + li a5,polynomial > > + xor a0,

Re: [RFC/RFA] [PATCH v7 01/12] Implement internal functions for efficient CRC computation.

2024-11-13 Thread Mariam Arutunian
On Tue, Nov 12, 2024 at 12:31 AM Jeff Law wrote: > > > On 11/9/24 12:43 PM, Mariam Arutunian wrote: > > Add two new internal functions (IFN_CRC, IFN_CRC_REV), to provide faster > > CRC generation. > > One performs bit-forward and the other bit-reversed CRC computa

Re: [RFC/RFA] [PATCH v7 08/12] Add a new pass for naive CRC loops detection.

2024-11-12 Thread Mariam Arutunian
On Tue, Nov 12, 2024 at 2:32 AM Jeff Law wrote: > > > On 11/9/24 12:44 PM, Mariam Arutunian wrote: > > This patch adds a new compiler pass aimed at identifying naive CRC > > implementations, > > characterized by the presence of a loop calculating a CRC (polynomial &

[RFC/RFA] [PATCH v7 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-11-09 Thread Mariam Arutunian
(optimize_crc_loop): New function. (execute): Add optimize_crc_loop function call. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/gimple-crc-optimization.cc | 78 ++ 1 file changed, 78 insertions(+) diff --git a/gcc/gimple-crc-optimization.cc

[RFC/RFA] [PATCH v7 08/12] Add a new pass for naive CRC loops detection.

2024-11-09 Thread Mariam Arutunian
s.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/common.opt | 10 + gcc/common.opt.urls|3 + gcc/doc/invoke.texi| 16 +- gcc/gimple-

[RFC/RFA] [PATCH v7 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-11-09 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian --- .../gcc.target/aarch64/crc-builtin-pmul64.c | 61 +++ 1 file changed, 61 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c diff

[RFC/RFA][PATCH v7 06/12] aarch64: Implement new expander for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam Arutunian Co-authored-by: Richard Sandiford --- gcc/config/aarch64/aarch64-protos.h | 3 + gcc/config/aarch64/aarch64-simd.md| 2 +- gcc/config/aarch64/aarch64.cc | 131

[RFC/RFA] [PATCH v7 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-11-09 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- .../gcc.target/riscv/crc-builtin-zbc32.c | 21 ++ .../gcc.target/riscv/crc-builtin-zbc64.c | 66

[RFC/RFA] [PATCH v7 10/12] Verify detected CRC loop with symbolic execution and LFSR matching.

2024-11-09 Thread Mariam Arutunian
public and static. (create_reversed_lfsr): New static function declaration. (create_forward_lfsr): New static function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/crc-verification.cc| 1299

[RFC/RFA][PATCH v7 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-11-09 Thread Mariam Arutunian
. * crc-CCIT-data16-zbc.c: Likewise. * crc-CCIT-data16-zbkc.c: Likewise. * crc-CCIT-data8-zbc.c: Likewise. * crc-CCIT-data8-zbkc.c: Likewise. * crc-coremark-16bitdata-zbc.c: Likewise. * crc-coremark-16bitdata-zbkc.c: Likewise. Signed-off-by: Mariam Arutunian

[RFC/RFA][PATCH v7 05/12] i386: Implement new expander for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
: Likewise. * crc-8-pclmul.c: Likewise. * crc-9-pclmul.c: Likewise. * crc-CCIT-data16-pclmul.c: Likewise. * crc-CCIT-data8-pclmul.c: Likewise. * crc-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/config/i386/i386-protos.h

[RFC/RFA][PATCH v7 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs.

2024-11-09 Thread Mariam Arutunian
-target32.c * gcc.dg/crc-builtin-target64.c Signed-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/builtin-types.def | 20 +++ gcc/builtins.cc | 114 +- gcc/builtins.def

[RFC/RFA] [PATCH v7 01/12] Implement internal functions for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
internal functions. * optabs.def (crc_optab, crc_rev_optab): New optabs. Signed-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/doc/md.texi | 14 ++ gcc/expr.cc | 372 gcc/expr.h | 6 + gcc

[RFC/RFA][PATCH v7 00/12] CRC optimization.

2024-11-09 Thread Mariam Arutunian
Hello, This patch series is a revised version of the following: https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668229.html. In this version: - Patch 09/12 has been updated with comments provided by Matevos, which were missing in the previously submitted series. - Patch 06/12 in

[RFC/RFA] [PATCH v6 09/12] Add symbolic execution support.

2024-11-09 Thread Mariam Arutunian
* sym-exec-expression-is-a-helper.h: New file. * sym-exec-expression.cc: New file. * sym-exec-expression.h: New file. * sym-exec-state.cc: New file. * sym-exec-state.h: New file. Signed-off-by: Mariam Arutunian Author: Matevos Mehrabyan Co-authored-by: Mariam Arutunian Mentored-by

[RFC/RFA][PATCH v6 06/12] aarch64: Implement new expander for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
-pmul.c: Likewise. * crc-coremark-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: Likewise. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam

[RFC/RFA] [PATCH v6 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-11-09 Thread Mariam Arutunian
(optimize_crc_loop): New function. (execute): Add optimize_crc_loop function call. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/gimple-crc-optimization.cc | 78 ++ 1 file changed, 78 insertions(+) diff --git a/gcc/gimple-crc-optimization.cc

[RFC/RFA] [PATCH v6 08/12] Add a new pass for naive CRC loops detection.

2024-11-09 Thread Mariam Arutunian
s.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/common.opt | 10 + gcc/common.opt.urls|3 + gcc/doc/invoke.texi| 16 +- gcc/gimple-

[RFC/RFA][PATCH v6 05/12] i386: Implement new expander for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
: Likewise. * crc-8-pclmul.c: Likewise. * crc-9-pclmul.c: Likewise. * crc-CCIT-data16-pclmul.c: Likewise. * crc-CCIT-data8-pclmul.c: Likewise. * crc-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/config/i386/i386-protos.h

[RFC/RFA] [PATCH v6 10/12] Verify detected CRC loop with symbolic execution and LFSR matching.

2024-11-09 Thread Mariam Arutunian
public and static. (create_reversed_lfsr): New static function declaration. (create_forward_lfsr): New static function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/crc-verification.cc| 1298

[RFC/RFA] [PATCH v6 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-11-09 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian --- .../gcc.target/aarch64/crc-builtin-pmul64.c | 61 +++ 1 file changed, 61 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c diff

[RFC/RFA] [PATCH v6 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-11-09 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- .../gcc.target/riscv/crc-builtin-zbc32.c | 21 ++ .../gcc.target/riscv/crc-builtin-zbc64.c | 66

[RFC/RFA][PATCH v6 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-11-09 Thread Mariam Arutunian
. * crc-CCIT-data16-zbc.c: Likewise. * crc-CCIT-data16-zbkc.c: Likewise. * crc-CCIT-data8-zbc.c: Likewise. * crc-CCIT-data8-zbkc.c: Likewise. * crc-coremark-16bitdata-zbc.c: Likewise. * crc-coremark-16bitdata-zbkc.c: Likewise. Signed-off-by: Mariam Arutunian

[RFC/RFA][PATCH v6 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs.

2024-11-09 Thread Mariam Arutunian
-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/builtin-types.def | 20 +++ gcc/builtins.cc | 114 +- gcc/builtins.def | 21 +++- gcc/builtins.h

[RFC/RFA] [PATCH v6 01/12] Implement internal functions for efficient CRC computation.

2024-11-09 Thread Mariam Arutunian
internal functions. * optabs.def (crc_optab, crc_rev_optab): New optabs. Signed-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/doc/md.texi | 14 ++ gcc/expr.cc | 372 gcc/expr.h | 6 + gcc

[RFC/RFA][PATCH v6 00/12] CRC optimization.

2024-11-09 Thread Mariam Arutunian
Hello, This patch series is a revised version of the following: https://gcc.gnu.org/pipermail/gcc-patches/2024-October/665855.html . I have addressed the feedback on the emit_crc function in patch 01/12, and Matevos has provided additional comments for patch 09/12. Thanks, Mariam

Re: [RFC/RFA][PATCH v5 00/12] CRC optimization.

2024-10-19 Thread Mariam Arutunian
On Sat, Oct 19, 2024, 17:58 Jeff Law wrote: > > > On 10/18/24 9:00 AM, Mariam Arutunian wrote: > > Hello, > > > > This patch series is a respin of the following: https://gcc.gnu.org/ > > pipermail/gcc-patches/2024-September/662961.html <https://gcc.gnu

[RFC/RFA] [PATCH v5 10/12] Verify detected CRC loop with symbolic execution and LFSR matching.

2024-10-18 Thread Mariam Arutunian
public and static. (create_reversed_lfsr): New static function declaration. (create_forward_lfsr): New static function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/crc-verification.cc| 1298

[RFC/RFA] [PATCH v5 01/12] Implement internal functions for efficient CRC computation.

2024-10-18 Thread Mariam Arutunian
internal functions. * optabs.def (crc_optab, crc_rev_optab): New optabs. Signed-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/doc/md.texi | 14 ++ gcc/expr.cc | 371 gcc/expr.h | 6 + gcc

[RFC/RFA] [PATCH v5 09/12] Add symbolic execution support.

2024-10-18 Thread Mariam Arutunian
* sym-exec-expression-is-a-helper.h: New file. * sym-exec-expression.cc: New file. * sym-exec-expression.h: New file. * sym-exec-state.cc: New file. * sym-exec-state.h: New file. Signed-off-by: Mariam Arutunian Author: Matevos Mehrabyan Co-authored-by: Mariam Arutunian Mentored-by

[RFC/RFA] [PATCH v5 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-10-18 Thread Mariam Arutunian
(optimize_crc_loop): New function. (execute): Add optimize_crc_loop function call. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/gimple-crc-optimization.cc | 78 ++ 1 file changed, 78 insertions(+) diff --git a/gcc/gimple-crc-optimization.cc

[RFC/RFA] [PATCH v5 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-10-18 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian --- .../gcc.target/aarch64/crc-builtin-pmul64.c | 61 +++ 1 file changed, 61 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c diff

[RFC/RFA][PATCH v5 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-10-18 Thread Mariam Arutunian
. * crc-CCIT-data16-zbc.c: Likewise. * crc-CCIT-data16-zbkc.c: Likewise. * crc-CCIT-data8-zbc.c: Likewise. * crc-CCIT-data8-zbkc.c: Likewise. * crc-coremark-16bitdata-zbc.c: Likewise. * crc-coremark-16bitdata-zbkc.c: Likewise. Signed-off-by: Mariam Arutunian

[RFC/RFA][PATCH v5 06/12] aarch64: Implement new expander for efficient CRC computation.

2024-10-18 Thread Mariam Arutunian
-pmul.c: Likewise. * crc-coremark-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: Likewise. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam

[RFC/RFA][PATCH v5 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs.

2024-10-18 Thread Mariam Arutunian
-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/builtin-types.def | 20 +++ gcc/builtins.cc | 114 +- gcc/builtins.def | 21 +++- gcc/builtins.h

[RFC/RFA] [PATCH v5 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-10-18 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- .../gcc.target/riscv/crc-builtin-zbc32.c | 21 ++ .../gcc.target/riscv/crc-builtin-zbc64.c | 66

[RFC/RFA] [PATCH v5 08/12] Add a new pass for naive CRC loops detection.

2024-10-18 Thread Mariam Arutunian
s.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/common.opt | 10 + gcc/common.opt.urls|3 + gcc/doc/invoke.texi| 16 +- gcc/gimple-

[RFC/RFA][PATCH v5 05/12] i386: Implement new expander for efficient CRC computation.

2024-10-18 Thread Mariam Arutunian
: Likewise. * crc-8-pclmul.c: Likewise. * crc-9-pclmul.c: Likewise. * crc-CCIT-data16-pclmul.c: Likewise. * crc-CCIT-data8-pclmul.c: Likewise. * crc-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/config/i386/i386-protos.h

[RFC/RFA][PATCH v5 00/12] CRC optimization.

2024-10-18 Thread Mariam Arutunian
Hello, This patch series is a respin of the following: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662961.html. Although I sent [PATCH v4 00/12] to the mailing list, it didn’t appear in the archives, so I've provided the link to the first patch ([PATCH v4 01/12]). The original patch s

Re: [RFC/RFA] [PATCH v4 01/12] Implement internal functions for efficient CRC computation

2024-10-10 Thread Mariam Arutunian
On Wed, Oct 9, 2024 at 7:45 AM Jeff Law wrote: > > > On 10/8/24 4:52 AM, Mariam Arutunian wrote: > > > > > > On Sun, Sep 29, 2024 at 9:08 PM Jeff Law > <mailto:jeffreya...@gmail.com>> wrote: > > > > > > > > On 9/13/24 5

Re: [RFC/RFA] [PATCH v4 01/12] Implement internal functions for efficient CRC computation

2024-10-08 Thread Mariam Arutunian
On Sun, Sep 29, 2024 at 9:08 PM Jeff Law wrote: > > > On 9/13/24 5:05 AM, Mariam Arutunian wrote: > > Add two new internal functions (IFN_CRC, IFN_CRC_REV), to provide faster > > CRC generation. > > One performs bit-forward and the other bit-reversed CRC computa

[RFC/RFA] [PATCH v4 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-09-13 Thread Mariam Arutunian
(optimize_crc_loop): New function. (execute): Add optimize_crc_loop function call. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/gimple-crc-optimization.cc | 78 ++ 1 file changed, 78 insertions(+) diff --git a/gcc/gimple-crc-optimization.cc

[RFC/RFA] [PATCH v4 09/12] Add symbolic execution support.

2024-09-13 Thread Mariam Arutunian
* sym-exec-expression-is-a-helper.h: New file. * sym-exec-expression.cc: New file. * sym-exec-expression.h: New file. * sym-exec-state.cc: New file. * sym-exec-state.h: New file. Signed-off-by: Mariam Arutunian Author: Matevos Mehrabyan Co-authored-by: Mariam Arutunian Mentored-by: Jeff Law

[RFC/RFA] [PATCH v4 10/12] Verify detected CRC loop with symbolic execution and LFSR matching

2024-09-13 Thread Mariam Arutunian
-state.h (is_bit_vector): Reorder, make the function public and static. (create_reversed_lfsr): New static function declaration. (create_forward_lfsr): New static function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/crc

[RFC/RFA][PATCH v4 06/12] aarch64: Implement new expander for efficient CRC computation

2024-09-13 Thread Mariam Arutunian
-pmul.c: Likewise. * crc-coremark-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: Likewise. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam

Re: [RFC/RFA] [PATCH v2 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-09-13 Thread Mariam Arutunian
On Thu, Aug 22, 2024 at 1:19 PM Richard Biener wrote: > On Fri, Aug 2, 2024 at 6:15 PM Mariam Arutunian > wrote: > > > > After the loop exit an internal function call (CRC, CRC_REV) is added, > > and its result is assigned to the output CRC variable (the variable >

[RFC/RFA] [PATCH v4 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-09-13 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian --- .../gcc.target/aarch64/crc-builtin-pmul64.c | 61 +++ 1 file changed, 61 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c diff

[RFC/RFA][PATCH v4 05/12] i386: Implement new expander for efficient CRC computation

2024-09-13 Thread Mariam Arutunian
: Likewise. * crc-8-pclmul.c: Likewise. * crc-9-pclmul.c: Likewise. * crc-CCIT-data16-pclmul.c: Likewise. * crc-CCIT-data8-pclmul.c: Likewise. * crc-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/config/i386/i386-protos.h

[RFC/RFA] [PATCH v4 08/12] Add a new pass for naive CRC loops detection.

2024-09-13 Thread Mariam Arutunian
var. * tree-pass.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- gcc/Makefile.in|1 + gcc/common.opt | 10 + gcc/common.opt.urls|3 + gcc/doc/invoke.texi|

[RFC/RFA][PATCH v4 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs

2024-09-13 Thread Mariam Arutunian
-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/builtin-types.def | 20 +++ gcc/builtins.cc | 114 +- gcc/builtins.def | 21 +++- gcc/builtins.h

[RFC/RFA] [PATCH v4 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-09-13 Thread Mariam Arutunian
: Mariam Arutunian Mentored-by: Jeff Law --- gcc/config/riscv/bitmanip.md | 63 +++ gcc/config/riscv/iterators.md | 6 + gcc/config/riscv/riscv-protos.h | 3 + gcc/config/riscv/riscv.cc | 155 ++ gcc/config

[RFC/RFA] [PATCH v4 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-09-13 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian Mentored-by: Jeff Law --- .../gcc.target/riscv/crc-builtin-zbc32.c | 21 ++ .../gcc.target/riscv/crc-builtin-zbc64.c | 66

[RFC/RFA] [PATCH v4 01/12] Implement internal functions for efficient CRC computation

2024-09-13 Thread Mariam Arutunian
internal functions. * optabs.def (crc_optab, crc_rev_optab): New optabs. Signed-off-by: Mariam Arutunian Co-authored-by: Joern Rennecke Mentored-by: Jeff Law --- gcc/doc/md.texi | 14 ++ gcc/expr.cc | 371 gcc/expr.h | 6 + gcc

Re: [RFC/RFA][PATCH v2 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-08-28 Thread Mariam Arutunian
On Sun, Aug 25, 2024 at 9:41 PM Jeff Law wrote: > > > On 7/26/24 12:06 PM, Mariam Arutunian wrote: > >If the target is ZBC or ZBKC, it uses clmul instruction for the CRC > > calculation. > > Otherwise, if the target is ZBKB, generates table-based CRC, but for &

Re: [RFC/RFA] [PATCH v2 09/12] Add symbolic execution support.

2024-08-27 Thread Mariam Arutunian
On Tue, Aug 27, 2024 at 12:25 PM Richard Biener wrote: > On Mon, Aug 26, 2024 at 5:26 PM Matevos Mehrabyan > wrote: > > > > > > > > On Mon, Aug 26, 2024 at 2:44 AM Jeff Law wrote: > >> > >> > >> > >> On 8/20/24 5:41 AM, Richard Biener wrote: > >> > >> > > >> > So the store-merging variant IIRC

Re: [RFC/RFA][PATCH v4 06/12] aarch64: Implement new expander for efficient CRC computation

2024-08-24 Thread Mariam Arutunian
On Fri, Aug 23, 2024, 15:03 Richard Biener wrote: > On Fri, Aug 23, 2024 at 9:55 AM Mariam Arutunian > wrote: > > > > > > On Wed, Aug 21, 2024 at 5:56 PM Richard Sandiford < > richard.sandif...@arm.com> wrote: > >> > >> Mariam Arutunian wri

Re: [RFC/RFA][PATCH v4 06/12] aarch64: Implement new expander for efficient CRC computation

2024-08-23 Thread Mariam Arutunian
On Wed, Aug 21, 2024 at 5:56 PM Richard Sandiford wrote: > Mariam Arutunian writes: > > This patch introduces two new expanders for the aarch64 backend, > > dedicated to generate optimized code for CRC computations. > > The new expanders are designed to leverage specific

Re: [RFC/RFA][PATCH v3 06/12] aarch64: Implement new expander for efficient CRC computation

2024-08-20 Thread Mariam Arutunian
I sent the new version and added you as a co-author. Thanks, Mariam On Fri, Aug 16, 2024 at 7:25 PM Mariam Arutunian wrote: > > > On Fri, Aug 9, 2024 at 7:22 PM Richard Sandiford < > richard.sandif...@arm.com> wrote: > >> Sorry again for the slow review. :( >&g

[RFC/RFA][PATCH v4 06/12] aarch64: Implement new expander for efficient CRC computation

2024-08-20 Thread Mariam Arutunian
-pmul.c: Likewise. * crc-coremark-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: Likewise. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam

Re: [RFC/RFA][PATCH v3 06/12] aarch64: Implement new expander for efficient CRC computation

2024-08-16 Thread Mariam Arutunian
versed version below: > > Mariam Arutunian writes: > > [...] > > diff --git a/gcc/config/aarch64/aarch64.cc > b/gcc/config/aarch64/aarch64.cc > > index ee12d8897a8..546a379fd74 100644 > > --- a/gcc/config/aarch64/aarch64.cc > > +++ b/gcc/config/aarch64/aarch64.cc > &

Re: [RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-08-12 Thread Mariam Arutunian
On Fri, Aug 2, 2024 at 2:12 PM Richard Biener wrote: > On Wed, Jul 31, 2024 at 10:15 AM Mariam Arutunian > wrote: > > > > This patch adds a new compiler pass aimed at identifying naive CRC > implementations, > > characterized by the presence of a loop calculati

[RFC/RFA] [PATCH v2 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-08-02 Thread Mariam Arutunian
(get_data): New function. (optimize_crc_loop): Likewise. (build_polynomial_without_1): Likewise. (execute): Add optimize_crc_loop function call. Signed-off-by: Mariam Arutunian diff --git a/gcc/gimple-crc-optimization.cc b/gcc/gimple-crc-optimization.cc index bd84d553a60..4de383419a0

[RFC/RFA] [PATCH v2 09/12] Add symbolic execution support.

2024-07-31 Thread Mariam Arutunian
: New file. * condition.h: New file. * expression-is-a-helper.h: New file. * expression.cc: New file. * expression.h: New file. * state.cc: New file. * state.h: New file. Signed-off-by: Mariam Arutunian diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 0

[RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-07-31 Thread Mariam Arutunian
ion. (enable_fdo_optimizations): Enable gimple-crc-optimization. * passes.def (pass_crc_optimization): Add new pass. * timevar.def (TV_GIMPLE_CRC_OPTIMIZATION): New timevar. * tree-pass.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian diff --

[RFC/RFA][PATCH v3 06/12] aarch64: Implement new expander for efficient CRC computation

2024-07-26 Thread Mariam Arutunian
. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 1d3f94c813e..7c6bf9d2c71 100644 --- a/gcc/config

[RFC/RFA][PATCH v2 05/12] i386: Implement new expander for efficient CRC computation

2024-07-26 Thread Mariam Arutunian
-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index dbc861fb1ea..845a5dcd9ab 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -288,6 +288,8 @@ extern void

[RFC/RFA][PATCH v2 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-07-26 Thread Mariam Arutunian
-16bitdata-zbc.c: Likewise. * crc-coremark-16bitdata-zbkc.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 8769a6b818b..9683ac48ef6 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md

[RFC/RFA][PATCH v2 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs

2024-07-26 Thread Mariam Arutunian
* gcc.dg/crc-builtin-rev-target64.c * gcc.dg/crc-builtin-target32.c * gcc.dg/crc-builtin-target64.c Signed-off-by: Mariam Arutunian diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def index c97d6bad1de..a0c4b8b9ca6 100644 --- a/gcc/builtin-types.def

[RFC/RFA][PATCH v2 01/12] Implement internal functions for efficient CRC computation

2024-07-26 Thread Mariam Arutunian
. (direct_crc_optab_supported_p): Likewise. (expand_crc_optab_fn): New function * internal-fn.def (CRC, CRC_REV): New internal functions. * optabs.def (crc_optab, crc_rev_optab): New optabs. Signed-off-by: Mariam Arutunian diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index

Re: [RFC/RFA] [PATCH 06/12] aarch64: Implement new expander for efficient CRC computation

2024-07-03 Thread Mariam Arutunian
On Sat, Jun 8, 2024 at 3:41 PM Richard Sandiford wrote: > Mariam Arutunian writes: > > This patch introduces two new expanders for the aarch64 backend, > > dedicated to generate optimized code for CRC computations. > > The new expanders are designed to leverage specific

[RFC/RFA] [PATCH v2 06/12] aarch64: Implement new expanders for efficient CRC computation

2024-07-02 Thread Mariam Arutunian
-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: Likewise. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. * crc-crc32c-data16.c: Likewise. * crc-crc32c-data32.c: Likewise. * crc-crc32c-data8.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config

Re: [RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-06-19 Thread Mariam Arutunian
On Sun, Jun 9, 2024 at 2:00 AM Jeff Law wrote: > > > On 5/29/24 5:12 AM, Mariam Arutunian wrote: > > > > > IIRC we looked at the problem of canonicalizing the loop into a form > > where we didn't necessarily have conditional blocks, instead we had &

Re: [RFC/RFA] [PATCH 06/12] aarch64: Implement new expander for efficient CRC computation

2024-06-19 Thread Mariam Arutunian
On Sat, Jun 8, 2024 at 3:41 PM Richard Sandiford wrote: > Mariam Arutunian writes: > > This patch introduces two new expanders for the aarch64 backend, > > dedicated to generate optimized code for CRC computations. > > The new expanders are designed to leverage specific

Re: [RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-06-19 Thread Mariam Arutunian
On Sun, Jun 9, 2024 at 1:48 AM Jeff Law wrote: > > > On 6/4/24 7:41 AM, Mariam Arutunian wrote: > >/Mariam, your thoughts on whether or not those two phases could handle a > > loop with two CRC calculations inside, essentially creating two calls to

Re: [RFC/RFA] [PATCH 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-06-09 Thread Mariam Arutunian
On Sat, Jun 8, 2024, 09:53 Richard Sandiford wrote: > Thanks a lot for doing this! It's a really nice series. > Thank you for your positive feedback and for your review and suggestions on the patch series. Just had a comment on the long division helper: > > Mariam

Re: [RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-06-04 Thread Mariam Arutunian
Sorry for the late response; somehow, I didn't receive the last few messages. >>* Am 30.05.2024 um 00:31 schrieb Jeff Law >>: *>> >>*  *>> >>>* On 5/28/24 1:01 AM, Richard Biener wrote: *>>>>* On Fri, May 24, 2024 at 10:46 AM Mariam Aru

Re: [RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-05-29 Thread Mariam Arutunian
On Tue, May 28, 2024 at 8:20 AM Jeff Law wrote: > > > On 5/24/24 2:42 AM, Mariam Arutunian wrote: > > This patch adds a new compiler pass aimed at identifying naive CRC > > implementations, > > characterized by the presence of a loop calculating a CRC (polynomial &

Re: [RFC/RFA] [PATCH 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-05-27 Thread Mariam Arutunian
On Sat, May 25, 2024 at 10:32 PM Jeff Law wrote: > > > On 5/24/24 2:41 AM, Mariam Arutunian wrote: > > If the target is ZBC or ZBKC, it uses clmul instruction for the CRC > > calculation. > > Otherwise, if the target is ZBKB, generates table-based CRC, > > but fo

Re: [RFC/RFA] [PATCH 01/12] Implement internal functions for efficient CRC computation

2024-05-27 Thread Mariam Arutunian
On Sat, May 25, 2024 at 9:40 PM Jeff Law wrote: > > > On 5/24/24 2:41 AM, Mariam Arutunian wrote: > > Add two new internal functions (IFN_CRC, IFN_CRC_REV), to provide faster > > CRC generation. > > One performs bit-forward and the other bit-reversed CRC computa

Re: [RFC/RFA][PATCH 00/12] CRC optimization

2024-05-27 Thread Mariam Arutunian
implementations. This would require a completely different algorithm than the one used for bitwise implementations. Thanks, Mariam On Sun, May 26, 2024 at 10:23 PM NightStrike wrote: > > > On Fri, May 24, 2024, 04:42 Mariam Arutunian > wrote: > >> Hello! >> This pa

Re: [RFC/RFA] [PATCH 12/12] Add tests for CRC detection and generation.

2024-05-25 Thread Mariam Arutunian
On Sat, May 25, 2024, 22:34 Jeff Law wrote: > > > On 5/24/24 2:42 AM, Mariam Arutunian wrote: > >gcc/testsuite/gcc.c-torture/compile/ > > > > * crc-11.c: New test. > > * crc-15.c: Likewise. > > * crc-16.c: Likewise. > > * crc

Re: [RFC/RFA] [PATCH 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-05-25 Thread Mariam Arutunian
On Sat, May 25, 2024, 22:35 Jeff Law wrote: > > > On 5/24/24 2:41 AM, Mariam Arutunian wrote: > >gcc/testsuite/gcc.target/riscv/ > > > > * crc-builtin-zbc32.c: New file. > > * crc-builtin-zbc64.c: Likewise. > OK once prerequisites are approved. > > jeff > Thank you. >

[RFC/RFA] [PATCH 10/12] Verify detected CRC loop with symbolic execution and LFSR matching

2024-05-24 Thread Mariam Arutunian
. (create_forward_lfsr): New static function declaration. Signed-off-by: Mariam Arutunian diff --git a/gcc/Makefile.in b/gcc/Makefile.in index aab909c3510..1996a60078c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1716,6 +1716,7 @@ OBJS = \ tree-iterator.o \ tree-logical-location.o \ tree

[RFC/RFA] [PATCH 11/12] Replace the original CRC loops with a faster CRC calculation.

2024-05-24 Thread Mariam Arutunian
ip.cc. * tree-ssa-loop-manip.cc (destroy_loop): Add, move function from tree-loop-distribution.cc. * tree-ssa-loop-manip.h (destroy_loop): Add extern function declaration. Signed-off-by: Mariam Arutunian diff --git a/gcc/gimple-crc-optimization.cc b/gcc/gimple-crc-optimization.cc index 039506

[RFC/RFA] [PATCH 08/12] Add a new pass for naive CRC loops detection

2024-05-24 Thread Mariam Arutunian
def (TV_GIMPLE_CRC_OPTIMIZATION): New timevar. * tree-pass.h (make_pass_crc_optimization): New extern function declaration. Signed-off-by: Mariam Arutunian diff --git a/gcc/Makefile.in b/gcc/Makefile.in index a7f15694c34..e9e2ecc3a17 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -171

[RFC/RFA] [PATCH 05/12] i386: Implement new expander for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
: Likewise. * crc-8-pclmul.c: Likewise. * crc-9-pclmul.c: Likewise. * crc-CCIT-data16-pclmul.c: Likewise. * crc-CCIT-data8-pclmul.c: Likewise. * crc-coremark-16bitdata-pclmul.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386

[RFC/RFA] [PATCH 09/12] Add symbolic execution support.

2024-05-24 Thread Mariam Arutunian
(8), crc(7), ... crc(1), crc(0) ^ 1 Co-authored-by: Mariam Arutunian gcc/ * Makefile.in (OBJS): Add sym-exec/expression.o, sym-exec/state.o, sym-exec/condition.o. * configure (sym-exec): New subdir. gcc/sym-exec/ * condition.cc: New file. * condition.h: New file. * expre

[RFC/RFA] [PATCH 07/12] aarch64: Add CRC built-ins test for the target AES.

2024-05-24 Thread Mariam Arutunian
gcc/testsuite/gcc.target/aarch64/ * crc-builtin-pmul64.c: New test. Signed-off-by: Mariam Arutunian diff --git a/gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c b/gcc/testsuite/gcc.target/aarch64/crc-builtin-pmul64.c new file mode 100644 index 000..d8bb1724a65 --- /dev/null

[RFC/RFA] [PATCH 04/12] RISC-V: Add CRC built-ins tests for the target ZBC.

2024-05-24 Thread Mariam Arutunian
gcc/testsuite/gcc.target/riscv/ * crc-builtin-zbc32.c: New file. * crc-builtin-zbc64.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c b/gcc/testsuite/gcc.target/riscv/crc-builtin-zbc32.c new file mode 100644 index 000

[RFC/RFA] [PATCH 02/12] Add built-ins and tests for bit-forward and bit-reversed CRCs

2024-05-24 Thread Mariam Arutunian
-target32.c * gcc.c-torture/compile/crc-builtin-target64.c Signed-off-by: Mariam Arutunian diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def index c97d6bad1de..a0c4b8b9ca6 100644 --- a/gcc/builtin-types.def +++ b/gcc/builtin-types.def @@ -829,6 +829,26 @@ DEF_FUNCTION_TYPE_3

[RFC/RFA] [PATCH 06/12] aarch64: Implement new expander for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
. * crc-CCIT-data8-pmul.c: Likewise. * crc-coremark-16bitdata-pmul.c: Likewise. * crc-crc32-data16.c: New test. * crc-crc32-data32.c: Likewise. * crc-crc32-data8.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64

[RFC/RFA] [PATCH 03/12] RISC-V: Add CRC expander to generate faster CRC.

2024-05-24 Thread Mariam Arutunian
: Likewise. * crc-coremark-16bitdata-zbc.c: Likewise. Signed-off-by: Mariam Arutunian diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 8769a6b818b..c98d451f404 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -973,3 +973,66

[RFC/RFA] [PATCH 01/12] Implement internal functions for efficient CRC computation

2024-05-24 Thread Mariam Arutunian
-off-by: Mariam Arutunian diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index 5730bda80dc..be68ef860f9 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -8557,6 +8557,20 @@ operand 2, greater than operand 2 or is unordered with operand 2. This pattern is not allowed to @code{FAIL}. +@cindex

  1   2   >