Skip to content

Commit

Permalink
Fix abstract numeric cases for comparisons, length builtin (gpuweb#3112)
Browse files Browse the repository at this point in the history
  • Loading branch information
dneto0 authored Jun 29, 2022
1 parent 83c5c62 commit dc47e66
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions wgsl/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5454,40 +5454,40 @@ See [[#sync-builtin-functions]].
<td>|e1|: |T|<br>|e2|: |T|<br>
|S| is AbstractInt, AbstractFloat, bool, i32, u32, f32, or f16<br>
|T| is |S| or vec|N|&lt;|S|&gt;<br>
|TB| is bool if |T| is scalar or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `==` |e2|`:` |TB|
<td>Equality. [=Component-wise=] when |T| is a vector.
<tr algorithm="inequality">
<td>|e1|: |T|<br>|e2|: |T|<br>
|S| is AbstractInt, AbstractFloat, bool, i32, u32, or f32<br>
|T| is |S| or vec|N|&lt;|S|&gt;<br>
|TB| is bool if |T| is scalar or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `!=` |e2|`:` |TB|
<td>Inequality. [=Component-wise=] when |T| is a vector.
<tr algorithm="less than">
<td>|e1|: |T|<br>|e2|: |T|<br>[ALLNUMERICDECL]<br>
|TB| is bool if |T| is scalar, or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `<` |e2|`:` |TB|
<td>Less than. [=Component-wise=] when |T| is a vector.
<tr algorithm="less than equal">
<td>|e1|: |T|<br>|e2|: |T|<br>[ALLNUMERICDECL]<br>
|TB| is bool if |T| is scalar, or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `<=` |e2|`:` |TB|
<td>Less than or equal. [=Component-wise=] when |T| is a vector.
<tr algorithm="greater than">
<td>|e1|: |T|<br>|e2|: |T|<br>[ALLNUMERICDECL]<br>
|TB| is bool if |T| is scalar, or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `>` |e2|`:` |TB|
<td>Greater than. [=Component-wise=] when |T| is a vector.
<tr algorithm="greater than equal">
<td>|e1|: |T|<br>|e2|: |T|<br>[ALLNUMERICDECL]<br>
|TB| is bool if |T| is scalar, or<br>
vec|N|&lt;bool&gt; if |T| is a vector
|TB| is vec|N|&lt;bool&gt; if |T| is a vector,<br>
otherwise |TB| is bool
<td class="nowrap">|e1| `>=` |e2|`:` |TB|
<td>Greater than or equal. [=Component-wise=] when |T| is a vector.

Expand Down Expand Up @@ -11243,8 +11243,9 @@ but a value may infer the type.
<td>[ALLFLOATINGDECL]
<tr>
<td>Description
<td>Returns the length of `e` (e.g. `abs(e)` if `T` is a scalar, or
`sqrt(e[0]`<sup>`2`</sup> `+ e[1]`<sup>`2`</sup> `+ ...)` if `T` is a vector).
<td>Returns the length of `e`.<br>
Evaluates to `abs(e)` if `T` is scalar or AbstractFloat.<br>
Evaluates to `sqrt(e[0]`<sup>`2`</sup> `+ e[1]`<sup>`2`</sup> `+ ...)` if `T` is a vector type.
</table>

### `log` ### {#log-builtin}
Expand Down

0 comments on commit dc47e66

Please sign in to comment.