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

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Fri Oct 4 10:51:34 BST 2019


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

--- Comment #20 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #19)
> i just managed to visualise the example that i saw.  it was of two
> vectors where the "swizzler" (selector) was twice the length of
> each of the individual vectors.

That's not what I was thinking of for [f]swizzle2.

[f]swizzle2 has all 3 inputs with the same VL or scalar where the swizzle
selector has SUBVL=1.

So, as an example:
SUBVL = 4
VL = 2
rs1 (vector) = [[11, 12, 13, 14], [15, 16, 17, 18]]
rs2 (scalar) = 0o7620 (start at LSB digit and count up)
rs3 (vector) = [[19, 20, 21, 22], [23, 24, 25, 26]]

vshuffle2 will produce
rd = [[11, 13, 21, 22], [15, 17, 25, 26]]

if rs2 was instead:
rs2 (vector) = [0o4400, 0o3647]

vshuffle2 will produce
rd = [[11, 11, 19, 19], [26, 23, 25, 18]]

If it's still confusing, I can try to make a diagram.

Back to instruction encodings:
I did just realize that we will probably need the extra encoding space anyway
since DESTSUBVL doesn't necessarily equal SRCSUBVL.

Note that rs2 always has SUBVL=1, so we don't need to encode that.

One alternative is to only support swizzle2 with DESTSUBVL == SRCSUBVL and to
support swizzle[i] with separate DESTSUBVL and SRCSUBVL.

to generate a swizzle2 with non-matching SUBVL values, use a swizzlei right
after to remove the unneeded elements.

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


More information about the libre-riscv-dev mailing list