Skip to content

Commit

Permalink
Add Float16Array
Browse files Browse the repository at this point in the history
The Float16Array proposal for JavaScript adds a new TypedArray type holding IEEE binary16 floats. This change adds it to all of the lists of IDL TypedArray types.

Tests: web-platform-tests/wpt#45483.

Fixes #1310.
  • Loading branch information
bakkot authored Apr 8, 2024
1 parent 402a886 commit ca9d63d
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ urlPrefix: https://tc39.es/proposal-resizablearraybuffer/; spec: RESIZABLE-BUFFE
text: IsResizableArrayBuffer; url: sec-isresizablearraybuffer
</pre>

<pre class=biblio>
{
"PROPOSAL-FLOAT16ARRAY": {
"publisher": "Ecma",
"href": "https://tc39.es/proposal-float16array/",
"title": "Proposal to add float16 TypedArrays to JavaScript"
}
}
</pre>

<style>
pre.set {
font-size: 80%;
Expand Down Expand Up @@ -5597,6 +5607,7 @@ The <dfn id="dfn-typed-array-type" export>typed array types</dfn> are
{{Uint8ClampedArray}},
{{BigInt64Array}},
{{BigUint64Array}},
{{Float16Array}},
{{Float32Array}}, and
{{Float64Array}}.

Expand Down Expand Up @@ -6485,9 +6496,11 @@ data. The table below lists these types and the kind of buffer or view they repr
<tr>
<td><dfn id="idl-Uint8ClampedArray" interface>Uint8ClampedArray</dfn>
<td>A view on to a [=buffer type=] instance that exposes it as an array of unsigned 8-bit integers with clamped conversions
<tr>
<td><dfn id="idl-Float16Array" interface>Float16Array</dfn>
<td rowspan=3>A view on to a [=buffer type=] instance that exposes it as an array of IEEE 754 floating point numbers of the given size in bits; Float16Array corresponds to the ECMAScript proposal [[PROPOSAL-FLOAT16ARRAY]].
<tr>
<td><dfn id="idl-Float32Array" interface>Float32Array</dfn>
<td rowspan=2>A view on to a [=buffer type=] instance that exposes it as an array of IEEE 754 floating point numbers of the given size in bits
<tr>
<td><dfn id="idl-Float64Array" interface>Float64Array</dfn>
</table>
Expand All @@ -6514,6 +6527,7 @@ in [[#js-buffer-source-types]].
"Uint8ClampedArray"
"BigInt64Array"
"BigUint64Array"
"Float16Array"
"Float32Array"
"Float64Array"
</pre>
Expand Down Expand Up @@ -8807,7 +8821,8 @@ class, with the following additional restrictions on those objects.
{{Uint8ClampedArray}},
{{BigInt64Array}},
{{BigUint64Array}},
{{Float32Array}} or
{{Float16Array}},
{{Float32Array}}, or
{{Float64Array}} value
by running the following algorithm:

Expand Down Expand Up @@ -14666,7 +14681,7 @@ must support.
typedef (Int8Array or Int16Array or Int32Array or
Uint8Array or Uint16Array or Uint32Array or Uint8ClampedArray or
BigInt64Array or BigUint64Array or
Float32Array or Float64Array or DataView) ArrayBufferView;
Float16Array or Float32Array or Float64Array or DataView) ArrayBufferView;
</pre>

The {{ArrayBufferView}} typedef is used to represent
Expand Down

0 comments on commit ca9d63d

Please sign in to comment.