Simd: Naming shuffle instructions

Created on 15 May 2019  路  4Comments  路  Source: WebAssembly/simd

71 added a new shuffle instruction but was explicitly merged without consensus on the name of the new instruction or the instruction that PR renamed to v8x16.shuffle2_imm (previously v8x16.shuffle). Now that the instruction is merged into the proposal, we should return to the bikeshed of the names.

In the previous PR I held an informal vote for different parts of the naming schemes: https://github.com/WebAssembly/simd/pull/71#issuecomment-472691503

At time of writing, these are the results:

  • 3 votes for using permute* and shuffle* as the base names
  • 1 vote for using shuffle1* and shuffle2* as the base names
  • 0 votes for using _dyn as a suffix marking dynamic indices
  • 1 vote for using _vec as a suffix marking dynamic indices
  • 3 votes for not having a suffix to mark dynamic indices

If we went with the most popular results, our two instructions would be named v8x16.permute and v8x16.shuffle_imm. What does everyone think of that?

Most helpful comment

We talked about this at the last meeting, and reached a general consensus in the room that swizzle would be a good name for the single-argument version and shuffle for the two-argument version. @gnzlbg does that sound acceptable to you?

All 4 comments

Bump! With our new stage 2 status and @Honry about to start writing spec tests, it would be good to get the naming squared away. Please give me at least a quick :+1: if you would be fine with v8x16.permute and v8x16.shuffle_imm and a :confused: if you prefer something else.

The whole point of the names, as opposed to the binary encoding, is clarity. I still find it misleading that v8x16.permute does not perform a permutation. Something like v8x16.shuffle1 and v8x16.shuffle2_imm feel more accurate to me.

We talked about this at the last meeting, and reached a general consensus in the room that swizzle would be a good name for the single-argument version and shuffle for the two-argument version. @gnzlbg does that sound acceptable to you?

Sounds good, swizzle operations take one argument, allow repetition, and is a technical term in computer graphics.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

omnisip picture omnisip  路  3Comments

penzn picture penzn  路  9Comments

tlively picture tlively  路  4Comments

arunetm-zz picture arunetm-zz  路  11Comments

tlively picture tlively  路  8Comments