Re: RISC-V: Added support for CRC.

2023-09-27 Thread Jeff Law
On 9/26/23 12:56, Joern Rennecke wrote: What ultimately pushed us to keep moving forward on this effort was discovering numerous CRC loop implementations out in the wild, including 4 implementations (IIRC) in the kernel itself. I have always assumed that such must exist (CRCs are useful

Re: RISC-V: Added support for CRC.

2023-09-26 Thread Joern Rennecke
On Tue, 26 Sept 2023 at 14:18, Jeff Law wrote: > But the Coremark code is what it is. This isn't a whole lot > different than the work in the 90s which rewrote loops and compromised > some of the spec benchmarks, or the eqntott hack to simplify that one > key loop in eqntott. I think the

Re: RISC-V: Added support for CRC.

2023-09-26 Thread Alexander Monakov
On Tue, 26 Sep 2023, Jeff Law wrote: > What ultimately pushed us to keep moving forward on this effort was > discovering numerous CRC loop implementations out in the wild, including 4 > implementations (IIRC) in the kernel itself. The kernel employs bitwise CRC only in look-up table

Re: RISC-V: Added support for CRC.

2023-09-26 Thread Jeff Law
On 9/23/23 17:05, Joern Rennecke wrote: Mariam Harutyunyan: +++ b/gcc/ChangeLog @@ -1,3 +1,45 @@ +2023-08-03 Mariam Arutunian + It is common courtesy to include all authors in the list of authors for the ChangeLog; also, this may help people in the future understand the history of the

Re: RISC-V: Added support for CRC.

2023-09-26 Thread Oleg Endo
On Sun, 2023-09-24 at 00:05 +0100, Joern Rennecke wrote: > > Although maybe Oleg Endo's library, as mentioned in > https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591748.html , > might be suitable? What is the license for that? > > I haven't published the library, but I think I could do

Re: RISC-V: Added support for CRC.

2023-09-26 Thread Mariam Harutyunyan
On Sun, Sep 24, 2023, 00:05 Joern Rennecke wrote: > Mariam Harutyunyan: > +++ b/gcc/ChangeLog > @@ -1,3 +1,45 @@ > +2023-08-03 Mariam Arutunian > + > > It is common courtesy to include all authors in the list of authors > for the ChangeLog; also, > this may help people in the future

Re: RISC-V: Added support for CRC.

2023-09-24 Thread Joern Rennecke
On Sun, 24 Sept 2023 at 12:41, Alexander Monakov wrote: > > > On Sun, 24 Sep 2023, Joern Rennecke wrote: > > > It is a stated goal of coremark to test performance for CRC. > > I would expect a good CRC benchmark to print CRC throughput in > bytes per cycle or megabytes per second. > > I don't see

Re: RISC-V: Added support for CRC.

2023-09-24 Thread Alexander Monakov
On Sun, 24 Sep 2023, Joern Rennecke wrote: > It is a stated goal of coremark to test performance for CRC. I would expect a good CRC benchmark to print CRC throughput in bytes per cycle or megabytes per second. I don't see where Coremark states that goal. In the readme at

Re: RISC-V: Added support for CRC.

2023-09-23 Thread Joern Rennecke
Mariam Harutyunyan: +++ b/gcc/ChangeLog @@ -1,3 +1,45 @@ +2023-08-03 Mariam Arutunian + It is common courtesy to include all authors in the list of authors for the ChangeLog; also, this may help people in the future understand the history of the code better. While must of your patch is new, it

Re: RISC-V: Added support for CRC.

2023-08-21 Thread Mariam Harutyunyan via Gcc-patches
Thank you for the review. I'm already working on suggested changes. The answers to the few questions are attached here. Thanks, Mariam On Wed, Aug 16, 2023 at 8:59 AM Jeff Law wrote: > > > On 8/3/23 13:37, Mariam Harutyunyan via Gcc-patches wrote: > > This patch adds CRC support for the RISC-V

Re: RISC-V: Added support for CRC.

2023-08-17 Thread Alexander Monakov
On Wed, 16 Aug 2023, Philipp Tomsich wrote: > > > I fully expect that latency to drop within the next 12-18 months. In that > > > world, there's not going to be much benefit to using hand-coded libraries > > > vs > > > just letting the compiler do it. > > I would also hope that the

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 13:10, Alexander Monakov wrote: On Tue, 15 Aug 2023, Jeff Law wrote: Because if the compiler can optimize it automatically, then the projects have to do literally nothing to take advantage of it. They just compile normally and their bitwise CRC gets optimized down to either a

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Paul Koning via Gcc-patches
> On Aug 16, 2023, at 3:42 PM, Philipp Tomsich wrote: > > On Wed, 16 Aug 2023 at 21:10, Alexander Monakov wrote: >> >> >> On Tue, 15 Aug 2023, Jeff Law wrote: >> >>> Because if the compiler can optimize it automatically, then the projects >>> have >>> to do literally nothing to take

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Philipp Tomsich
On Wed, 16 Aug 2023 at 21:10, Alexander Monakov wrote: > > > On Tue, 15 Aug 2023, Jeff Law wrote: > > > Because if the compiler can optimize it automatically, then the projects > > have > > to do literally nothing to take advantage of it. They just compile normally > > and their bitwise CRC

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Alexander Monakov
On Tue, 15 Aug 2023, Jeff Law wrote: > Because if the compiler can optimize it automatically, then the projects have > to do literally nothing to take advantage of it. They just compile normally > and their bitwise CRC gets optimized down to either a table lookup or a clmul > variant. That's

Re: RISC-V: Added support for CRC.

2023-08-15 Thread Jeff Law via Gcc-patches
17 00:00:00 2001 From: Mariam Arutunian Date: Thu, 3 Aug 2023 15:59:57 +0400 Subject: [PATCH] RISC-V: Added support for CRC. If the target is ZBC, then the clmul instruction is used for the CRC code generation; otherwise, table-based CRC is generated. A table with 256 elements is used to store

Re: RISC-V: Added support for CRC.

2023-08-15 Thread Jeff Law via Gcc-patches
On 8/9/23 07:02, Paul Koning wrote: On Aug 9, 2023, at 2:32 AM, Alexander Monakov wrote: On Tue, 8 Aug 2023, Jeff Law wrote: If the compiler can identify a CRC and collapse it down to a table or clmul, that's a major win and such code does exist in the real world. That was the whole

Re: RISC-V: Added support for CRC.

2023-08-15 Thread Jeff Law via Gcc-patches
On 8/9/23 00:32, Alexander Monakov wrote: On Tue, 8 Aug 2023, Jeff Law wrote: If the compiler can identify a CRC and collapse it down to a table or clmul, that's a major win and such code does exist in the real world. That was the whole point behind the Fedora experiment -- to determine if

Re: RISC-V: Added support for CRC.

2023-08-09 Thread Paul Koning via Gcc-patches
> On Aug 9, 2023, at 2:32 AM, Alexander Monakov wrote: > > > On Tue, 8 Aug 2023, Jeff Law wrote: > >> If the compiler can identify a CRC and collapse it down to a table or clmul, >> that's a major win and such code does exist in the real world. That was the >> whole point behind the Fedora

Re: RISC-V: Added support for CRC.

2023-08-09 Thread Alexander Monakov
On Tue, 8 Aug 2023, Jeff Law wrote: > If the compiler can identify a CRC and collapse it down to a table or clmul, > that's a major win and such code does exist in the real world. That was the > whole point behind the Fedora experiment -- to determine if these things are > showing up in the

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Jeff Law via Gcc-patches
On 8/8/23 17:31, Andrew Pinski wrote: On Tue, Aug 8, 2023 at 4:17 PM Jeff Law via Gcc-patches wrote: On 8/8/23 10:38, Alexander Monakov wrote: On Tue, 8 Aug 2023, Jeff Law wrote: That was my thinking at one time. Then we started looking at the distros and found enough crc

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Andrew Pinski via Gcc-patches
On Tue, Aug 8, 2023 at 4:17 PM Jeff Law via Gcc-patches wrote: > > > > On 8/8/23 10:38, Alexander Monakov wrote: > > > > On Tue, 8 Aug 2023, Jeff Law wrote: > > > >> That was my thinking at one time. Then we started looking at the distros > >> and > >> found enough crc implementations in there

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Jeff Law via Gcc-patches
On 8/8/23 10:38, Alexander Monakov wrote: On Tue, 8 Aug 2023, Jeff Law wrote: That was my thinking at one time. Then we started looking at the distros and found enough crc implementations in there to change my mind about the overall utility. The ones I'm familiar with are all

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Alexander Monakov
On Tue, 8 Aug 2023, Jeff Law wrote: > That was my thinking at one time. Then we started looking at the distros and > found enough crc implementations in there to change my mind about the overall > utility. The ones I'm familiar with are all table-based and look impossible to pattern-match

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Jeff Law via Gcc-patches
On 8/8/23 09:22, Alexander Monakov wrote: Jeff, as I understand this all is happening only because Coremark contains use of bitwise CRC that affects benchmark scores. In another universe where - Coremark was careful to checksum outputs outside of timed sections, or - implemented CRC in a

Re: RISC-V: Added support for CRC.

2023-08-08 Thread Alexander Monakov
On Thu, 3 Aug 2023, Jeff Law wrote: > The end goal here is to actually detect bitwise CRC implementations in the > gimple optimizers and turn them into table lookups or carryless multiplies in > RTL. > > Mariam has that working end-to-end and has proposed a talk for the Cauldron on > the

Re: RISC-V: Added support for CRC.

2023-08-03 Thread Jeff Law via Gcc-patches
On 8/3/23 13:37, Mariam Harutyunyan via Gcc-patches wrote: This patch adds CRC support for the RISC-V architecture. It adds internal functions and built-ins specifically designed to handle CRC computations efficiently. If the target is ZBC, the clmul instruction is used for the CRC code

Re: RISC-V: Added support for CRC.

2023-08-03 Thread Mariam Harutyunyan via Gcc-patches
Hi. Thank you. I'll add. Best regards, Mariam On Thu, Aug 3, 2023, 23:56 Andrew Pinski wrote: > On Thu, Aug 3, 2023 at 12:38 PM Mariam Harutyunyan via Gcc-patches > wrote: > > > > This patch adds CRC support for the RISC-V architecture. It adds internal > > functions and built-ins

Re: RISC-V: Added support for CRC.

2023-08-03 Thread Andrew Pinski via Gcc-patches
On Thu, Aug 3, 2023 at 12:38 PM Mariam Harutyunyan via Gcc-patches wrote: > > This patch adds CRC support for the RISC-V architecture. It adds internal > functions and built-ins specifically designed to handle CRC computations > efficiently. > > If the target is ZBC, the clmul instruction is used

RISC-V: Added support for CRC.

2023-08-03 Thread Mariam Harutyunyan via Gcc-patches
9d2e9023c222501a1d9519bea3d5cdbd32b5a91e Mon Sep 17 00:00:00 2001 From: Mariam Arutunian Date: Thu, 3 Aug 2023 15:59:57 +0400 Subject: [PATCH] RISC-V: Added support for CRC. If the target is ZBC, then the clmul instruction is used for the CRC code generation; otherwise, table-based CRC is generated. A table with 256 elements