[libre-riscv-dev] partitioned compare and mux

Jacob Lifshay programmerjake at gmail.com
Fri Feb 7 21:06:18 GMT 2020


On Fri, Feb 7, 2020, 12:59 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> On Friday, February 7, 2020, Jacob Lifshay <programmerjake at gmail.com>
> wrote:
>
> > On Fri, Feb 7, 2020 at 11:12 AM Luke Kenneth Casson Leighton
> > <lkcl at lkcl.net> wrote:
> > >
> > > On Fri, Feb 7, 2020 at 6:06 PM Jacob Lifshay <programmerjake at gmail.com
> >
> > wrote:
> > >
> > > > Rather than adding subtract and negate modes, i think it would be
> more
> > > > worthwhile to implement carry-in/carry-out.
> > >
> > > because carry-in would be the "+1".  and ~b is just a straight
> > bit-invert.
> >
> > My point is that subtract and negate are kind-of special cases of
> > addition, it seems better to generalize all the way to add with
> > carry-in/out and then build a PartitionedAddSub built around the
> > extended PartitionedAdder that does the carry-in (with it optional for
> > borrow-in)
>
>
> we're going to need this for Power, they have carry in and out
>
> so would that make sense to be just two bits extra, one at the LSB, one at
> the MSB?
>

If we want to be able to schedule individual instructions to each
partition, we need a carry-in/carry-out per-partition.

>
> and per-element selectable b inversion. yosys would just
> > simplify the resulting gates (a trivial transformation of ~0 xor b to
> > ~b) for cases where it always subtracts.
>
>
> ok so a selectable Const from the constructor, you mean?  do we need a
> "dynamic" add/sub or is it enough to have something that generates optimal
> static code
>

dynamic would be useful for scheduling independent instructions to each
partition.

Jacob


More information about the libre-riscv-dev mailing list