[Libre-soc-bugs] [Bug 755] add grev instruction (OP_GREV)

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed May 18 12:02:38 BST 2022


https://bugs.libre-soc.org/show_bug.cgi?id=755

--- Comment #58 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #57)

> > and it turns out that 0x77777777 0x70707070 etc and many more
> > can be created as well.
>
> neat!

yeah, unexpected. it sort-of happened, but is kinda important to justify
adding such an expensive operation (1/3 of a Major opcode) especially
as "just" a bitmanip operation.

> > the AOI trick *cannot do that* because the bits A[i] and A[i^crossover]
> > are treated as *independent*
>
> that's not true, see:
> https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=26558305c986c30f6f786e77769c566c6104f085

ah great, i must have got the implementation wrong 

ok that's good - it's still not getting as diverse a range of constants.
* imm 0b1101110 will give f0f0f0f0... c0c0c0c0 80808080 88008800
  808000008080000 880000
* imm 0b100110 will give one single bit set, based on sh (which is nice)
  but i see a 2nd imm doing exactly the same thing
* imm 0b100111 is quite interesting, gives 20202020, 2222000022222

but there's no way to create 0xbbbb, 0x7777, 0x6666 etc which grevlut
somehow manages to do.

also there are a hell of a lot of zeros, 0xfffffffs, and so on, all wasted,
which tells me it's not "mixing" enough.

> This has the exact same aoi matrix that I proposed, just the inputs from sh are
> changed. it still has latency 6x aoi gates plus misc stuff on sh and
> input/output xor layers.
>
> it *can* generate 0x1000100010001 because the aoi matrix has the input/outputs
> invertable, giving you and-ing via de-morgan inversion of the or-gates inside
> the aoi matrix.
>
> I added in the thing where the aoi gates taking input from the left have
> different imm bits than the input from the right in the grev butterfly wires.
> (sorry, I can't think of a good way to describe it textually.)

yeah we're in new territory here. i used left and right as well,
i know what you mean.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list