jameysharp opened PR #8467 from jameysharp:x64-into-reg
to bytecodealliance:main
:
Previously, the operand collector required its arguments to be of type Reg. But the x86-64 backend uses newtype wrappers around Reg to ensure that different register classes don't get mixed up, so it had to convert types everywhere to pass registers to the operand collector.
This commit allows the operand collector to accept any type which implements
Into<Reg>
instead. The newtype wrappers already implemented that, so we can mostly just delete theto_reg
andto_writable_reg
calls.However, those calls were also automatically dereferencing borrows as needed, so to minimize the need for explicit dereferences I've also introduced implementations for converting from &Gpr/&Xmm to Reg. That doesn't help with the Writable-wrapped registers but it's good enough. I have a PR in progress which will clean it up the rest of the way.
jameysharp requested wasmtime-compiler-reviewers for a review on PR #8467.
jameysharp requested cfallin for a review on PR #8467.
cfallin submitted PR review:
So much cleaner; nice!
jameysharp merged PR #8467.
Last updated: Nov 22 2024 at 16:03 UTC