[libre-riscv-dev] [Bug 139] Add LD.X and ST.X? Strided

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Thu Oct 10 09:52:41 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=139

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

> the swizzles that use constants (other than just for a load-immediate) would
> usually be of the form [x, z, 0.0, 1.0] where both input elements and
> constants are specified at the same time.

With the destmask (as an immed) allowing selection of which to write as consts
and which as values, would it be acceptable to have that as 2 instructions?

Don't know the answer, there.

> > that in turn saves having to use an extra register - rs2 - in swizzle.
> > which would still need to be set up (loaded with an immediate).
> 
> That's true.
> alternatively [f]swizzlei could be left alone, and separate [f]swizzle2i
> instructions be added:
> 
> swizzle2i rd, rs1, swizzle
> is equivalent to
> li rtemp, swizzle
> swizzle2 rd=rd, rs1=rs1, rs2=rtemp, rs3=rd

Which would save on a li.

> Swizzle would be defined to read all of each subvector before writing the
> corresponding subvector to rd, tiny implementations can implement that by
> using a temporary register to store the read elements, still allowing
> operating on one element at a time. swizzle can detect all traps at the
> beginning, before writing anything, allowing subvector swizzles to not have
> to worry about the temporary register needing to be accessible for
> context-switching.
> 
> If there's enough free space in the [f]swizzlei encoding, some of it could
> be shared with [f]swizzle2i to save opcode space.
> 
> If we reuse JAL and other similar opcodes (SYSTEM? JALR?), we should have
> enough spare opcode space to be able to allocate that much space to swizzle
> due to its importance.

SYSTEM.

We have *one* major opcode left (CUSTOM-0) and I'd like it to be for the vector
ops.

So it is ok to use either the entirety of CUSTOM-0 and use RVV major for vector
ops, or the other way round.

If we need 8x fmt3 then CUSTOM-0 should be for swizzles.

Even mv.x could remain in the RVV major op.

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


More information about the libre-riscv-dev mailing list