remlse edited PR #6407:
related to #4134
remlse updated PR #6407.
cfallin submitted PR review:
This looks basically like what I expected -- I think it's a good addition to the suite of chaos techniques!
cfallin submitted PR review:
This looks basically like what I expected -- I think it's a good addition to the suite of chaos techniques!
cfallin created PR review comment:
We could perhaps choose a float or int here, so we get the increased register pressure / potential clobbering of both kinds of registers. I guess that implies two kinds of
gen_imm
as well.
remlse updated PR #6407.
remlse created PR review comment:
The floats aren't working yet, I still have to figure out how to properly use a floating point register.
remlse updated PR #6407.
remlse created PR review comment:
An immediate floating point value seems to compile to the immediate value being stored in a general purpose register first, then moved to a floating point register (xmm).
So I did it the same way here. But I assume the abstraction is not right yet. The
MachInst
trait shouldn't contain references to implementation details of a specific backend.If the
MachInst
trait had some methodgen_imm_f64
, what should it return? Just one of the existing instructions is not enough, I think, because a single instruction for immediate f64 values doesn't exist? And returning something likeOption<(Self, Self)>
also seems like a leaky abstraction.@cfallin maybe you have an idea for the right abstraction here?
cfallin created PR review comment:
@remlse a pattern we've used before successfully (see e.g. some instances in
abi.rs
) is to return aSmallVec<[Inst; 2]>
(tweak inlined size as appropriate for expected max size). Then we have something likefor inst in M::gen_seq(...) { self.emit(inst); }
or whatever is appropriate at the callsite.
remlse updated PR #6407.
remlse created PR review comment:
That works well, thanks.
MachInst::gen_imm_f64
still "leaks" the fact that there may be a temporary general purpose register required, are you ok with that?
cfallin created PR review comment:
Yep, that's fine, we have a notion of "this machine-specific sequence gets a tmp" elsewhere too. If you're happy with this please feel free to flip it to Ready to Review and I'll look over the whole thing!
remlse has marked PR #6407 as ready for review.
remlse requested elliottt for a review on PR #6407.
remlse requested wasmtime-compiler-reviewers for a review on PR #6407.
remlse created PR review comment:
@cfallin pinging in case you weren't notified when I marked the PR ready for review
cfallin created PR review comment:
Ah, thanks, indeed that does not send an email so I missed it. Taking a final look now.
cfallin submitted PR review:
LGTM!
cfallin merged PR #6407.
Last updated: Nov 22 2024 at 16:03 UTC