Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong opcodes for vector instructions in Index of Instructions #1473

Closed
ictrobot opened this issue May 15, 2022 · 1 comment · Fixed by #1475
Closed

Wrong opcodes for vector instructions in Index of Instructions #1473

ictrobot opened this issue May 15, 2022 · 1 comment · Fixed by #1475

Comments

@ictrobot
Copy link
Contributor

On https://webassembly.github.io/spec/core/appendix/index-instructions.html the opcodes for vector instructions are all two bytes, from 0xFD 0x00 -> 0xFD 0xFF, for example f64x2.convert_low_i32x4_u is listed as 0xFD 0xFF:

:math:`\F64X2.\VCONVERT\K{\_low\_i32x4\_u}` :math:`\hex{FD}~~\hex{FF}` :math:`[\V128] \to [\V128]` :ref:`validation <valid-vcvtop>` :ref:`execution <exec-vcvtop>`, :ref:`operator <op-convert_u>`

On https://webassembly.github.io/spec/core/binary/instructions.html#vector-instructions it states

They all have a one byte prefix, whereas the actual opcode is encoded by a variable-length unsigned integer

and f64x2.convert_low_i32x4_u is listed as 0xFD 255:u32, which I believe is effectively 0xFD 0xFF 0x01.

\hex{FD}~~255{:}\Bu32 &\Rightarrow& \F64X2.\VCONVERT\K{\_low\_i32x4\_u}\\ &&|&

@rossberg
Copy link
Member

Indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants