afonso360 opened PR #6568 from afonso360:riscv-simd-iadd-pairwise
to bytecodealliance:main
:
:wave: Hey,
This PR implements both the move instruction for vector registers and
iadd_pairwise
.We can't really implement
iadd_pairwise
in the best way possible, since that requires supporting LMUL > 1 which dynamically changes how many registers are available. (At least as far as I know, If regalloc supports this it would be nice to start using it)
afonso360 requested fitzgen for a review on PR #6568.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #6568.
afonso360 requested wasmtime-default-reviewers for a review on PR #6568.
afonso360 created PR review comment:
The
vslideup
instruction both modifies the destination register and also has the requirement that none of the input registers must be the same as the destination register.I've used
reg_late_use
andreg_reuse_def
to model this, but this seems wrong, and it also always emits a move before the instruction even when the register is otherwise unused, so there's probably a better way of expressing this which I'm not entirely sure how
afonso360 edited PR review comment.
afonso360 edited PR review comment.
cfallin submitted PR review.
cfallin submitted PR review.
cfallin created PR review comment:
I'm not sure I understand the intended semantics here: src and dst (
vd_src
andvd
, rather) must not overlap, butvd
is also a reuse ofvd_src
? Or is the non-overlap constraint betweenvs2
andvd
?
afonso360 created PR review comment:
Oops, I could have written that better.
vd
must be the same asvd_src
(since they are encoded in the same field), and none of the other inputs (vs2
andvm
) must be the same register asvd
.
vm
(The mask register) is slightly hidden here since it's not always applicable, but when it is, it's afixed_use(v0)
cfallin created PR review comment:
Ah, OK. The right way to encode that is probably to use a late-use on
vs2
(and onvm
when present), rather than onvd_src
, I think.
afonso360 updated PR #6568.
afonso360 created PR review comment:
:+1: I'm not entirely sure I did the right thing. I also couldn't find something along the lines of
reg_fixed_late_use
forvm
, does regalloc support encoding multiple constraints by callingreg_fixed_use
andreg_late_use
on the sameVReg
?
cfallin created PR review comment:
Yep, it should be possible to do that -- if it's not on the
OperandCollector
API we can add it. The early/late ("position"), use/def ("kind"), and fixed/any/reg/stack ("constraint") are all orthogonal fields of theOperand
.
afonso360 updated PR #6568.
afonso360 updated PR #6568.
afonso360 requested cfallin for a review on PR #6568.
cfallin submitted PR review.
cfallin merged PR #6568.
Last updated: Dec 23 2024 at 12:05 UTC