Skip to content

Commit 40850fe

Browse files
authored
chore: enhance comment for extract_lane functions to include "idx" argument needs to be compile time constant (#2890)
1 parent 285afb1 commit 40850fe

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

NOTICE

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ under the licensing terms detailed in LICENSE:
5959
* Matt Johnson-Pint <[email protected]>
6060
* Fabián Heredia Montiel <[email protected]>
6161
* Jonas Minnberg <[email protected]>
62+
* Kam Chehresa <[email protected]>
6263

6364
Portions of this software are derived from third-party works licensed under
6465
the following terms:

std/assembly/index.d.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,9 @@ declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i:
791791
declare namespace v128 {
792792
/** Creates a vector with identical lanes. */
793793
export function splat<T>(x: T): v128;
794-
/** Extracts one lane as a scalar. */
794+
/** Extracts one lane as a scalar. idx argument needs to be compile time constant. */
795795
export function extract_lane<T>(x: v128, idx: u8): T;
796-
/** Replaces one lane. */
796+
/** Replaces one lane. idx argument needs to be compile time constant.*/
797797
export function replace_lane<T>(x: v128, idx: u8, value: T): v128;
798798
/** Selects lanes from either vector according to the specified lane indexes. */
799799
export function shuffle<T>(a: v128, b: v128, ...lanes: u8[]): v128;
@@ -1051,11 +1051,11 @@ declare function i8x16(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i
10511051
declare namespace i8x16 {
10521052
/** Creates a vector with sixteen identical 8-bit integer lanes. */
10531053
export function splat(x: i8): v128;
1054-
/** Extracts one 8-bit integer lane as a signed scalar. */
1054+
/** Extracts one 8-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */
10551055
export function extract_lane_s(x: v128, idx: u8): i8;
1056-
/** Extracts one 8-bit integer lane as an unsigned scalar. */
1056+
/** Extracts one 8-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */
10571057
export function extract_lane_u(x: v128, idx: u8): u8;
1058-
/** Replaces one 8-bit integer lane. */
1058+
/** Replaces one 8-bit integer lane. idx argument needs to be compile time constant. */
10591059
export function replace_lane(x: v128, idx: u8, value: i8): v128;
10601060
/** Adds each 8-bit integer lane. */
10611061
export function add(a: v128, b: v128): v128;
@@ -1146,11 +1146,11 @@ declare function i16x8(a: i16, b: i16, c: i16, d: i16, e: i16, f: i16, g: i16, h
11461146
declare namespace i16x8 {
11471147
/** Creates a vector with eight identical 16-bit integer lanes. */
11481148
export function splat(x: i16): v128;
1149-
/** Extracts one 16-bit integer lane as a signed scalar. */
1149+
/** Extracts one 16-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */
11501150
export function extract_lane_s(x: v128, idx: u8): i16;
1151-
/** Extracts one 16-bit integer lane as an unsigned scalar. */
1151+
/** Extracts one 16-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */
11521152
export function extract_lane_u(x: v128, idx: u8): u16;
1153-
/** Replaces one 16-bit integer lane. */
1153+
/** Replaces one 16-bit integer lane. idx argument needs to be compile time constant. */
11541154
export function replace_lane(x: v128, idx: u8, value: i16): v128;
11551155
/** Adds each 16-bit integer lane. */
11561156
export function add(a: v128, b: v128): v128;
@@ -1267,9 +1267,9 @@ declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128;
12671267
declare namespace i32x4 {
12681268
/** Creates a vector with four identical 32-bit integer lanes. */
12691269
export function splat(x: i32): v128;
1270-
/** Extracts one 32-bit integer lane as a scalar. */
1270+
/** Extracts one 32-bit integer lane as a scalar. idx argument needs to be compile time constant. */
12711271
export function extract_lane(x: v128, idx: u8): i32;
1272-
/** Replaces one 32-bit integer lane. */
1272+
/** Replaces one 32-bit integer lane. idx argument needs to be compile time constant. */
12731273
export function replace_lane(x: v128, idx: u8, value: i32): v128;
12741274
/** Adds each 32-bit integer lane. */
12751275
export function add(a: v128, b: v128): v128;
@@ -1416,9 +1416,9 @@ declare function i64x2(a: i64, b: i64): v128;
14161416
declare namespace i64x2 {
14171417
/** Creates a vector with two identical 64-bit integer lanes. */
14181418
export function splat(x: i64): v128;
1419-
/** Extracts one 64-bit integer lane as a scalar. */
1419+
/** Extracts one 64-bit integer lane as a scalar. `idx` argument need to be compile time constant */
14201420
export function extract_lane(x: v128, idx: u8): i64;
1421-
/** Replaces one 64-bit integer lane. */
1421+
/** Replaces one 64-bit integer lane. idx argument needs to be compile time constant. */
14221422
export function replace_lane(x: v128, idx: u8, value: i64): v128;
14231423
/** Adds each 64-bit integer lane. */
14241424
export function add(a: v128, b: v128): v128;
@@ -1485,9 +1485,9 @@ declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128;
14851485
declare namespace f32x4 {
14861486
/** Creates a vector with four identical 32-bit float lanes. */
14871487
export function splat(x: f32): v128;
1488-
/** Extracts one 32-bit float lane as a scalar. */
1488+
/** Extracts one 32-bit float lane as a scalar. idx argument needs to be compile time constant. */
14891489
export function extract_lane(x: v128, idx: u8): f32;
1490-
/** Replaces one 32-bit float lane. */
1490+
/** Replaces one 32-bit float lane. idx argument needs to be compile time constant. */
14911491
export function replace_lane(x: v128, idx: u8, value: f32): v128;
14921492
/** Adds each 32-bit float lane. */
14931493
export function add(a: v128, b: v128): v128;
@@ -1575,9 +1575,9 @@ declare function f64x2(a: f64, b: f64): v128;
15751575
declare namespace f64x2 {
15761576
/** Creates a vector with two identical 64-bit float lanes. */
15771577
export function splat(x: f64): v128;
1578-
/** Extracts one 64-bit float lane as a scalar. */
1578+
/** Extracts one 64-bit float lane as a scalar. idx argument needs to be compile time constant. */
15791579
export function extract_lane(x: v128, idx: u8): f64;
1580-
/** Replaces one 64-bit float lane. */
1580+
/** Replaces one 64-bit float lane. idx argument needs to be compile time constant. */
15811581
export function replace_lane(x: v128, idx: u8, value: f64): v128;
15821582
/** Adds each 64-bit float lane. */
15831583
export function add(a: v128, b: v128): v128;

0 commit comments

Comments
 (0)