Rename internal opcodes to reflect final spec naming
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: lth, Assigned: yury, Mentored)
Details
(Keywords: good-first-bug)
Attachments
(1 file)
Fairly obviously, the names for the SIMD opcodes in WasmConstants.h sometimes reflects older names for some of the operations, we should update them to reduce the scope for confusion. Also, we have inconsistent naming conventions.
Less obviously, there are problems with many of the opcodes in that our names for them more or less diverge from the spec. There are good and bad reasons for this, many having to do with the history of the code and aggressive prototyping. But we should consider cleaning these names up now.
As an example of using an older name, what is now called v128.load8x8_s
used to be called i16x8.load_8x8_s
and so our internal opcode is I16x8LoadS8x8
. A better name would be V128LoadS8x8
or possibly even V128Load8x8S
.
As an example of inconsistent naming, we sometimes use 'SI' and 'UI' to indicate signed and unsigned ints, and sometimes just 'S' and 'U'. And sometimes, this signedness specifier comes before the layout specifier (I16x8WidenLowSI8x16
) and sometimes after (I16x8ExtAddPairwiseI8x16S
); the latter one actually also has the redundant I
before the layout too, so really here the layout is infix and the signedness is outfix, to coin a word.
By and large, the wasm instructions are sensibly named and our internal opcode names should probably just follow the wasm instruction names as far as possible, perhaps adding disambiguators at the end if it can't be avoided.
Obviously the opcode names are used to drive the compilers, and so it's possible that some of the function names in the compilers should be updated too, but I consider this something that should be investigated and done in a separate patch, minimally; possibly on a separate bug.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Pushed by ydelendik@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f3548d50d150 Rename internal opcodes to reflect final spec naming. r=lth
Comment 3•3 years ago
|
||
bugherder |
Description
•