Sitelet https://github.com/gpuweb/gpuweb/pull/2713
Skip to content

Remove shift tokens and add shift built-in functions - #2713

Merged
dneto0 merged 1 commit into
gpuweb:mainfrom
alan-baker:remove-shift-tokens
Mar 29, 2022
Merged

dneto0 merged 1 commit into
gpuweb:mainfrom
alan-baker:remove-shift-tokens

Conversation

@alan-baker

Copy link
Copy Markdown
Contributor

Fixes #2092

  • Remove the >>, <<, >>= and <<= tokens
  • Remove shift expressions and compound shift assignments
  • Add shiftLeft and shiftRight integer built-in functions

Fixes gpuweb#2092

* Remove the `>>`, `<<`, `>>=` and `<<=` tokens
* Remove shift expressions and compound shift assignments
* Add shiftLeft and shiftRight integer built-in functions
@alan-baker alan-baker added wgsl WebGPU Shading Language Issues wgsl resolved Resolved - waiting for a change to the WGSL specification wgsl:tokens WGSL tokenization and literals labels Mar 29, 2022
@github-actions

Copy link
Copy Markdown
Contributor

Previews, as seen when this build job started (d30b51e):
WebGPU | IDL
WGSL
Explainer

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dneto0
dneto0 merged commit 48efd97 into gpuweb:main Mar 29, 2022
github-actions Bot added a commit that referenced this pull request Mar 29, 2022
SHA: 48efd97
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request Mar 29, 2022
SHA: 48efd97
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request Mar 29, 2022
SHA: 48efd97
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dneto0 added a commit to dneto0/gpuweb that referenced this pull request May 31, 2022
Part 1:

  Revert "Remove shift tokens and add shift built-in functions (gpuweb#2713)"
  This reverts commit 48efd97.

Part 2:

  Since the removal of shift operators, the shiftLeft and shiftRight
  builtins added the ability to take operands that were AbstractInt
  or vectors of AbstractInt.

  We already have a rule that creation-time expressions must not
  overflow. For shift-left, that can only be determined if both its
  operands are abstract.  So split the description of shift-left
  into all-concrete operands, and all-abstract operands.

  Additionally, spell out the overflow condition for the all-abstract
  form of shift-left.

Fixes: gpuweb#2092
dneto0 added a commit to dneto0/gpuweb that referenced this pull request May 31, 2022
Part 1:

  Revert "Remove shift tokens and add shift built-in functions (gpuweb#2713)"
  This reverts commit 48efd97.

Part 2:

  Since the removal of shift operators, the shiftLeft and shiftRight
  builtins added the ability to take operands that were AbstractInt
  or vectors of AbstractInt.

  We already have a rule that creation-time expressions must not
  overflow. For shift-left, that can only be determined if both its
  operands are abstract.  So split the description of shift-left
  into all-concrete operands, and all-abstract operands.

  Additionally, spell out the overflow condition for the all-abstract
  form of shift-left.

Fixes: gpuweb#2092
dneto0 added a commit that referenced this pull request Jun 1, 2022
* Add shift operators, remove shiftLeft, shiftRight builtins

Part 1:

  Revert "Remove shift tokens and add shift built-in functions (#2713)"
  This reverts commit 48efd97.

Part 2:

  Since the removal of shift operators, the shiftLeft and shiftRight
  builtins added the ability to take operands that were AbstractInt
  or vectors of AbstractInt.

  We already have a rule that creation-time expressions must not
  overflow. For shift-left, that can only be determined if both its
  operands are abstract.  So split the description of shift-left
  into all-concrete operands, and all-abstract operands.

  Additionally, spell out the overflow condition for the all-abstract
  form of shift-left.

Fixes: #2092

* Apply review feedback

* Split right-shift into concrete and abstract forms
jdarpinian pushed a commit to jdarpinian/gpuweb that referenced this pull request Aug 12, 2022
* Add shift operators, remove shiftLeft, shiftRight builtins

Part 1:

  Revert "Remove shift tokens and add shift built-in functions (gpuweb#2713)"
  This reverts commit 48efd97.

Part 2:

  Since the removal of shift operators, the shiftLeft and shiftRight
  builtins added the ability to take operands that were AbstractInt
  or vectors of AbstractInt.

  We already have a rule that creation-time expressions must not
  overflow. For shift-left, that can only be determined if both its
  operands are abstract.  So split the description of shift-left
  into all-concrete operands, and all-abstract operands.

  Additionally, spell out the overflow condition for the all-abstract
  form of shift-left.

Fixes: gpuweb#2092

* Apply review feedback

* Split right-shift into concrete and abstract forms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl resolved Resolved - waiting for a change to the WGSL specification wgsl:tokens WGSL tokenization and literals wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context-aware tokenization: Sometimes >> is better parsed as two copies of > (similar for ]] )

2 participants