Sitelet https://github.com/gpuweb/gpuweb/issues/825
Skip to content

Should logical-right-shift have a distinct spelling from arithmetic-right-shift? #825

Description

@kainino0x

Raised on #790, see there for more context.

I see 2.5 options here:

  1. Java-style: >> always means signed arithmetic right shift. >>> always means logical right shift. Note: Java does not have signed integer types.
  2. C-style: >> means either arithmetic or logical right shift depending on the signedness of the LHS. Signedness-casts allow you to choose.
  3. function-style (matches Add unordered float compares #706 resolution): >> is always arithmetic right shift and is only valid on signed LHS types. Function call syntax is needed for logical right shift.

Activity

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

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions