Re: RFC: integer division by multiply with invariant reciprocal

2007-03-25 Thread Jeffrey Law
On Sun, 2007-03-25 at 22:24 -0700, Andrew Pinski wrote: > On 3/25/07, Charles J. Tabony <[EMAIL PROTECTED]> wrote: > > > So I think that the easiest way to integrate this with the rest of the > > > compiler is to have a target hook that emits trees to compute SHIFT, INV1 > > > and INV2. > > I don'

Re: RFC: integer division by multiply with invariant reciprocal

2007-03-25 Thread Andrew Pinski
On 3/25/07, Charles J. Tabony <[EMAIL PROTECTED]> wrote: > So I think that the easiest way to integrate this with the rest of the > compiler is to have a target hook that emits trees to compute SHIFT, INV1 > and INV2. I don't think target hooks to expand trees early is a good idea. RTL is not

Re: RFC: integer division by multiply with invariant reciprocal

2007-03-25 Thread Charles J. Tabony
> So I think that the easiest way to integrate this with the rest of the > compiler is to have a target hook that emits trees to compute SHIFT, INV1 > and INV2. (define_tree_expand "name" "condition" { preparation statements; } ) :-)

RFC: integer division by multiply with invariant reciprocal

2007-03-25 Thread Joern Rennecke
The strategy that the SHMEDIA port uses to do cse and loop invariant code motion for division by invariant reciprocal can in principle be used by any processor that has a reasonable fast instructions for count leading sign bits (can be substituted with count leading zero bits), widening or highpart