Re: RFA: crc builtin functions & optimizations

2022-03-16 Thread Joern Rennecke
> and there needs to be code to actually expand the builtin using optabs. > And something needs to be done to make match.pd work on the output. Never mind that bit, that was just due to a function argument type mismatch on the last argument of the crc built-in functions.

Re: RFA: crc builtin functions & optimizations

2022-03-16 Thread Joern Rennecke
On Wed, 16 Mar 2022 at 08:15, Richard Biener wrote: > The canonical place to transform loops into builtins would be loop > distribution. > Another place would be final value replacement since you basically replace > the reduction result with a call to the builtin, but I think > loop-distribution

Re: RFA: crc builtin functions & optimizations

2022-03-16 Thread Richard Biener via Gcc-patches
On Tue, Mar 15, 2022 at 4:15 PM Joern Rennecke wrote: > > On 15/03/2022, Richard Biener wrote: > > > Why's this a new pass? Every walk over all insns costs time. > > If should typically scan considerably less than all the insns. > > > The pass > > lacks any comments as to what CFG / stmt struct

Re: RFA: crc builtin functions & optimizations

2022-03-15 Thread Joern Rennecke
On 15/03/2022, Richard Biener wrote: > Why's this a new pass? Every walk over all insns costs time. The pass > lacks any comments as to what CFG / stmt structure is matched. From > a quick look it seems like it first(?) statically matches a stmt sequence > without considering intermediate stmt

Re: RFA: crc builtin functions & optimizations

2022-03-15 Thread Joern Rennecke
On 15/03/2022, Richard Biener wrote: > Why's this a new pass? Every walk over all insns costs time. If should typically scan considerably less than all the insns. > The pass > lacks any comments as to what CFG / stmt structure is matched. I've put a file in: config/riscv/tree-crc-doc.txt wo

Re: RFA: crc builtin functions & optimizations

2022-03-15 Thread Richard Biener via Gcc-patches
On Tue, Mar 15, 2022 at 1:32 AM Joern Rennecke wrote: > > Most microprocessors have efficient ways to perform CRC operations, be > that with lookup tables, rotates, or even special instructions. > However, because we lack a representation for CRC in the compiler, we > can't do proper instruction s

Re: RFA: crc builtin functions & optimizations

2022-03-15 Thread Joern Rennecke
On Tue, 15 Mar 2022 at 02:17, Oleg Endo wrote: > > In my own CRC library I've got ~30 'commonly used' CRC types, based on > the following generic definition: > > This being a library makes it relatively easy to tune and customize for > various systems. ... > How would that work together with you

Fwd: RFA: crc builtin functions & optimizations

2022-03-15 Thread Joern Rennecke
Oops, that was meant to go to the list too. On Tue, 15 Mar 2022 at 01:04, Andrew Pinski wrote: > > On Mon, Mar 14, 2022 at 5:33 PM Joern Rennecke > wrote: > > > > Most microprocessors have efficient ways to perform CRC operations, be > > that with lookup tables, rotates, or even special instruc

Re: RFA: crc builtin functions & optimizations

2022-03-15 Thread Martin Jambor
Hello, just one question On Tue, Mar 15 2022, Joern Rennecke wrote: > Most microprocessors have efficient ways to perform CRC operations, be > that with lookup tables, rotates, or even special instructions. > However, because we lack a representation for CRC in the compiler, we > can't do pro

Re: RFA: crc builtin functions & optimizations

2022-03-14 Thread Oleg Endo
On Mon, 2022-03-14 at 18:04 -0700, Andrew Pinski via Gcc-patches wrote: > On Mon, Mar 14, 2022 at 5:33 PM Joern Rennecke > wrote: > > > > Most microprocessors have efficient ways to perform CRC operations, be > > that with lookup tables, rotates, or even special instructions. > > However, because

Re: RFA: crc builtin functions & optimizations

2022-03-14 Thread Andrew Pinski via Gcc-patches
On Mon, Mar 14, 2022 at 5:33 PM Joern Rennecke wrote: > > Most microprocessors have efficient ways to perform CRC operations, be > that with lookup tables, rotates, or even special instructions. > However, because we lack a representation for CRC in the compiler, we > can't do proper instruction s

RFA: crc builtin functions & optimizations

2022-03-14 Thread Joern Rennecke
Most microprocessors have efficient ways to perform CRC operations, be that with lookup tables, rotates, or even special instructions. However, because we lack a representation for CRC in the compiler, we can't do proper instruction selection. With this patch I seek out to rectify this, I've avoid