jlb6740 opened PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 requested bnjbvr for a review on PR #2151.
jlb6740 requested abrown and bnjbvr for a review on PR #2151.
jlb6740 requested cfallin, abrown and bnjbvr for a review on PR #2151.
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 has marked PR #2151 as ready for review.
jlb6740 requested bnjbvr for a review on PR #2151.
jlb6740 requested abrown and bnjbvr for a review on PR #2151.
jlb6740 requested cfallin, abrown and bnjbvr for a review on PR #2151.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
nit: here and below, for shift operations, can you use
>>
(respectively<<
for left shifts), please? I think it is a bit more usual for pseudo-code.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
nit: can you add a space after the comment opening slash, before "The", please?
bnjbvr created PR Review Comment:
It is an error to reuse an input register and write into it; the RHS might be reused after this particular CLIF instruction, and there's no indication to regalloc that it ought to be preserve it. Instead, we need to copy RHS into a temporary, and use that, here. Note the vreg copy might not become a copy machine instruction, since regalloc may coalesce those two vregs.
Also,
rhs
is a RegMem, so it can be either a register or memory, and here theto_reg().unwrap()
assumes it's in a register. When definingrhs
, you need to useinput_to_reg
and notinput_to_reg_mem
to reflect that you want it to be in a register.
bnjbvr created PR Review Comment:
Can I recommend to also use the actual register names for the summary, here, that is:
dst
when it's used, in place ofA
, etc.?
bnjbvr created PR Review Comment:
This is the only use of
lhs_tmp2
, and at this point we could still reuselhs
, so we should be able to avoid thelhs_tmp2
temporary at this point.
jlb6740 submitted PR Review.
jlb6740 created PR Review Comment:
Absolutely .. :+1:
jlb6740 submitted PR Review.
jlb6740 created PR Review Comment:
:+1:
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
bnjbvr requested cfallin, abrown and bnjbvr for a review on PR #2151.
bnjbvr submitted PR Review.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
In addition to the above comment (which I still think would be nice to address, please :)), I have another suggestion that would spare one right shift.
The current decomposition does
(Ah * Bl) << 32 + (Al * Bh) << 32 + Al * Bl
. I would suggest to factor out the<< 32
, so have(Ah * Bl) + (Al * Bh)
and then apply the left shift to this; it would spare one left shift operation. Does it make sense? (This is how Spidermonkey does it, fwiw.)
jlb6740 submitted PR Review.
jlb6740 created PR Review Comment:
Hi @bnjbvr First of all note, in the latest push yesterday I switched which input referred to the lhs and which referred to the rhs as that was not consistent/correct. For this specific comment what is now the lhs needed the input to be input_to_reg_mem because of the Pmuludq instructions. Specifically https://github.com/bytecodealliance/wasmtime/blob/c2af20b113e509a603db78740cb146ea3fb2246b/cranelift/codegen/src/isa/x64/lower.rs#L599 and https://github.com/bytecodealliance/wasmtime/blob/c2af20b113e509a603db78740cb146ea3fb2246b/cranelift/codegen/src/isa/x64/lower.rs#L610. Am I missing understanding something here?
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
input_to_reg_mem
means that the input will be put into a register or a memory operand, and we don't know which one. So we can't useto_reg().unwrap()
on the result of aninput_to_reg_mem
call, because the operand might be in memory, andto_reg()
returnsNone
in this case. Instead, you want to useinput_to_reg
, which will always return a register operand, and create aRegMem::reg(...)
operand when you need to use it for an instruction that requires aRegMem
. Does it help?
jlb6740 submitted PR Review.
jlb6740 created PR Review Comment:
Ok .. And I see you've renamed this :-). So I am still a little uncertain about the reuse of input registers .. is it at any time to use them as a temporary output? I've reworked the algorithm to factor out that shift and modified some things without using too many temps but it's not clear to me if what I have in this update I am about to push is the optimal usage.
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 requested cfallin, abrown and bnjbvr for a review on PR #2151.
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
bnjbvr submitted PR Review.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
I think I was the one who suggested using the dst register as a temporary, but thinking about it: sorry, we can't do this. It might be that
lhs
will get the same physical register asdst
(iflhs
's final use is for this instruction), thus this move would clobberlhs
before it's used in the nextpmuludq
instruction. Instead, you'll need to use a temporary in place ofdst
here and in the next instruction; I think you can reuserhs_1
though, since it's dead at this point. (This might require a finalgen_move(dst, rhs_1, ty))
after the whole sequence, which is fine too.)
bnjbvr created PR Review Comment:
(here's the second time)
bnjbvr created PR Review Comment:
nit: here and below, this can be simplified to
lhs_1
instead of the whole expression (lhs_1.to_reg()
returns a non-writable register, andWritable::from_reg
makes it writable again; the initiallhs_1
is writeable).
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 submitted PR Review.
jlb6740 created PR Review Comment:
Makes sense. Thanks!
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 updated PR #2151 from add-i64x2.mul
to main
:
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jlb6740 merged PR #2151.
Last updated: Dec 23 2024 at 12:05 UTC