Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Should v8x16.shuffle be i8x16.shuffle? #38

Closed

Description

@tlively

The v8x16.shuffle name correctly avoids interpreting the lanes as integers, but it is the only instruction using this style of vector type naming, so it can be confusing and surprising to the reader (e.g. me). There are also no interpretations of an 8-bit lane other than i8, so avoiding lane interpretation in the name seems unnecessary. I therefore propose changing v8x16.shuffle to i8x16.shuffle based on the principle of least astonishment.

Activity

  1. sunfishcode commented on Sep 5, 2018

    @sunfishcode
    Member

    To me the surprising thing is the choice to use a single shuffle that's independent of lane size or element type, because that's different from most other SIMD abstraction layers. But with that design, the name v8x16.shuffle seems natural. It's not an 'i' integer operation, because this is the way one shuffles floating-point operators too. So it's similar to names like v128.const.

  2. tlively commented on Sep 5, 2018

    @tlively
    MemberAuthor

    I wonder if v128.shuffle would make more sense, then. As you mentioned, this instruction is currently the only way to shuffle vectors of any type, and the "v128" prefix strikes me as a good choice for instructions that operate on full vectors without interpreting lane boundaries or contents. I don't feel too strongly about this, though. The "v8x16" name was just surprising to me when I first saw it.

  3. arunetm commented on Sep 24, 2018

    @arunetm
    Collaborator

    v8x16.shuffle was preserved as its functionality subsumed all other shuffles. It makes sense to preserve the v128.shuffle naming for the reasons pointed out above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions