[libre-riscv-dev] spike-sv c.mv twin-predication working

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Oct 4 15:49:47 BST 2018


ok so i have c.mv working, with some preliminary unit tests, i had to
do a big reorganisation to get it running, as i'd gone in the wrong
direction initially.

basically, twin-predication on c.mv is how VSPLAT, VINSERT, VGATHER
and VSCATTER are implemented.  two offsets (src,dest) are incremented
to find the "1s" in the (src,dest) predication, starting from the LSB
of each of the predicates.  just like a combined bit-manipulation
scatter/gather algorithm, when the first "1" in each of the src and
dest predication is encountered, that's where the first MV takes
place.  repeat until run out of bits in either src or dest predicate.

for VINSERT it's very simple: only one bit of the target predicate is set.

i could use some help on how zeroing would work, as i've not thought
that through yet: just dealing with the implementaton of
gather/scatter has been a headache :)

basically now, though, this was one of the major milestones, to get
twin-predication running, and now that it is, FCVT, LOAD, STORE,
LOAD-FP, STORE-FP, they follow the exact same pattern.

l.

[1] https://git.libre-riscv.org/?p=riscv-tests.git;a=commit;h=4e6d03ed96b7c6a2d390fd51b7baae1bfded832e
[2] https://git.libre-riscv.org/?p=riscv-isa-sim.git;a=commit;h=833752a4ba3a70eb50aa51193409295a7ecceb55
[3] https://libre-riscv.org/simple_v_extension/specification/#c_mv



More information about the libre-riscv-dev mailing list