rahulchaphalkar opened PR #10316 from rahulchaphalkar:sse-alu-instructions
to bytecodealliance:main
:
Implement the following SSE instructions:
xorpd
xorps
andpd
andps
addpd
addps
subpd
subps
orps
The opcode for
*ps
variants of these instructions isNP 0F xx
. NP has the following explanation in manual:NP — Indicates the use of 66/F2/F3 prefixes (beyond those already part of the instructions opcode) are not allowed with the instruction. Such use will either cause an invalid-opcode exception (#UD) or result in the encoding for a different instruction.
There is an existing
NoPrefix
prefix, but I have not reused that to serve aboveNP
as there might be some difference in the intended meaning. Also,NP
doesn't classify as a prefix technically. I am thinking to address this in a later patch which would deal with prefix parsing. Any thoughts or feedback on this is welcome.
My thinking isNP
doesn't functionally do anything, so it is fine to ignore it. We just need a way forvalidate
function to check this.
rahulchaphalkar requested cfallin for a review on PR #10316.
rahulchaphalkar requested wasmtime-compiler-reviewers for a review on PR #10316.
rahulchaphalkar updated PR #10316.
abrown requested abrown for a review on PR #10316.
abrown submitted PR review:
Had a couple of code movement comments but overall this all makes sense to me. Thanks!
abrown created PR review comment:
Let's remove the old emission. In a recent PR I began removing these for scalar instructions. It ensures that our
is_xmm_mem
is operating as expected.
abrown created PR review comment:
Some minor nits about organizing these new instructions:
- let's put them at the bottom of the file with their own comment header, e.g.,
// SSE vector addition.
or the like- can we order them from smallest to largest? I.e., packed single-precision (
ps = f32x4
) first and then packed double-precision (pd = f64x2
).
abrown created PR review comment:
And on that note, I believe that the ISLE we generate already has the signature
(... (Xmm XmmMem) Xmm)
which is what we need here. We can drop theis_xmm_mem
extractor for these instructions.
rahulchaphalkar updated PR #10316.
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
abrown submitted PR review.
abrown merged PR #10316.
Last updated: Apr 18 2025 at 00:13 UTC