Skip to content

[Bug Report] Inconsistent 0xFD instruction names #1401

@asukakenji

Description

@asukakenji

The instruction names written on https://webassembly.github.io/spec/core/binary/instructions.html#vector-instructions are different from that written on https://webassembly.github.io/spec/core/appendix/index-instructions.html.

In the "binary" page, the name of 0xFD 0x01 is v128.load8x8_s, while in the "index" page, its name is i16x8.load8x8_s. According to my observation, i16x8.load8x8_s should be the correct name and v128.load8x8_s is a typo by copy-and-paste.

Some other instructions have the same issue. Here is a summary of the discrepancies I found:

Opcode "binary" page "index" page
0xFD 0x01 v128.load8x8_s i16x8.load8x8_s
0xFD 0x02 v128.load8x8_u i16x8.load8x8_u
0xFD 0x03 v128.load16x4_s i32x4.load16x4_s
0xFD 0x04 v128.load16x4_u i32x4.load16x4_u
0xFD 0x05 v128.load32x2_s i64x2.load32x2_s
0xFD 0x06 v128.load32x2_u i64x2.load32x2_u
0xFD 0x07 v128.load8_splat i8x16.load_splat
0xFD 0x08 v128.load16_splat i16x8.load_splat
0xFD 0x09 v128.load32_splat i32x4.load_splat
0xFD 0x0A v128.load64_splat i64x2.load_splat

The source code of the "binary" page could be found here:

\hex{FD}~~1{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{8x8\_s}~m \\ &&|&
\hex{FD}~~2{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{8x8\_u}~m \\ &&|&
\hex{FD}~~3{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{16x4\_s}~m \\ &&|&
\hex{FD}~~4{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{16x4\_u}~m \\ &&|&
\hex{FD}~~5{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{32x2\_s}~m \\ &&|&
\hex{FD}~~6{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{32x2\_u}~m \\ &&|&
\hex{FD}~~7{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{8\_splat}~m \\ &&|&
\hex{FD}~~8{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{16\_splat}~m \\ &&|&
\hex{FD}~~9{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{32\_splat}~m \\ &&|&
\hex{FD}~~10{:}\Bu32~~m{:}\Bmemarg &\Rightarrow& \V128.\LOAD\K{64\_splat}~m \\ &&|&

while the source code of the "index" page could be found here:

Instruction(r'\I16X8.\LOAD\K{8x8\_s}~\memarg', r'\hex{FD}~~\hex{01}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I16X8.\LOAD\K{8x8\_u}~\memarg', r'\hex{FD}~~\hex{02}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I32X4.\LOAD\K{16x4\_s}~\memarg', r'\hex{FD}~~\hex{03}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I32X4.\LOAD\K{16x4\_u}~\memarg', r'\hex{FD}~~\hex{04}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I64X2.\LOAD\K{32x2\_s}~\memarg', r'\hex{FD}~~\hex{05}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I64X2.\LOAD\K{32x2\_u}~\memarg', r'\hex{FD}~~\hex{06}', r'[\I32] \to [\V128]', r'valid-load-extend', r'exec-load-extend'),
Instruction(r'\I8X16.\LOAD\K{\_splat}~\memarg', r'\hex{FD}~~\hex{07}', r'[\I32] \to [\V128]', r'valid-load-splat', r'exec-load-splat'),
Instruction(r'\I16X8.\LOAD\K{\_splat}~\memarg', r'\hex{FD}~~\hex{08}', r'[\I32] \to [\V128]', r'valid-load-splat', r'exec-load-splat'),
Instruction(r'\I32X4.\LOAD\K{\_splat}~\memarg', r'\hex{FD}~~\hex{09}', r'[\I32] \to [\V128]', r'valid-load-splat', r'exec-load-splat'),
Instruction(r'\I64X2.\LOAD\K{\_splat}~\memarg', r'\hex{FD}~~\hex{0A}', r'[\I32] \to [\V128]', r'valid-load-splat', r'exec-load-splat'),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions