From 40850fea035ab998b31cef0a8b9bbe73336437f2 Mon Sep 17 00:00:00 2001 From: kam chehresa Date: Thu, 12 Dec 2024 05:20:21 -0800 Subject: [PATCH] chore: enhance comment for extract_lane functions to include "idx" argument needs to be compile time constant (#2890) --- NOTICE | 1 + std/assembly/index.d.ts | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/NOTICE b/NOTICE index 30596e20bd..e7a2601827 100644 --- a/NOTICE +++ b/NOTICE @@ -59,6 +59,7 @@ under the licensing terms detailed in LICENSE: * Matt Johnson-Pint * Fabián Heredia Montiel * Jonas Minnberg +* Kam Chehresa Portions of this software are derived from third-party works licensed under the following terms: diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 4dbee416a8..eb8a177b31 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -791,9 +791,9 @@ declare function v128(a: i8, b: i8, c: i8, d: i8, e: i8, f: i8, g: i8, h: i8, i: declare namespace v128 { /** Creates a vector with identical lanes. */ export function splat(x: T): v128; - /** Extracts one lane as a scalar. */ + /** Extracts one lane as a scalar. idx argument needs to be compile time constant. */ export function extract_lane(x: v128, idx: u8): T; - /** Replaces one lane. */ + /** Replaces one lane. idx argument needs to be compile time constant.*/ export function replace_lane(x: v128, idx: u8, value: T): v128; /** Selects lanes from either vector according to the specified lane indexes. */ export function shuffle(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 declare namespace i8x16 { /** Creates a vector with sixteen identical 8-bit integer lanes. */ export function splat(x: i8): v128; - /** Extracts one 8-bit integer lane as a signed scalar. */ + /** Extracts one 8-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */ export function extract_lane_s(x: v128, idx: u8): i8; - /** Extracts one 8-bit integer lane as an unsigned scalar. */ + /** Extracts one 8-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */ export function extract_lane_u(x: v128, idx: u8): u8; - /** Replaces one 8-bit integer lane. */ + /** Replaces one 8-bit integer lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: i8): v128; /** Adds each 8-bit integer lane. */ 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 declare namespace i16x8 { /** Creates a vector with eight identical 16-bit integer lanes. */ export function splat(x: i16): v128; - /** Extracts one 16-bit integer lane as a signed scalar. */ + /** Extracts one 16-bit integer lane as a signed scalar. idx argument needs to be compile time constant. */ export function extract_lane_s(x: v128, idx: u8): i16; - /** Extracts one 16-bit integer lane as an unsigned scalar. */ + /** Extracts one 16-bit integer lane as an unsigned scalar. idx argument needs to be compile time constant. */ export function extract_lane_u(x: v128, idx: u8): u16; - /** Replaces one 16-bit integer lane. */ + /** Replaces one 16-bit integer lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: i16): v128; /** Adds each 16-bit integer lane. */ export function add(a: v128, b: v128): v128; @@ -1267,9 +1267,9 @@ declare function i32x4(a: i32, b: i32, c: i32, d: i32): v128; declare namespace i32x4 { /** Creates a vector with four identical 32-bit integer lanes. */ export function splat(x: i32): v128; - /** Extracts one 32-bit integer lane as a scalar. */ + /** Extracts one 32-bit integer lane as a scalar. idx argument needs to be compile time constant. */ export function extract_lane(x: v128, idx: u8): i32; - /** Replaces one 32-bit integer lane. */ + /** Replaces one 32-bit integer lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: i32): v128; /** Adds each 32-bit integer lane. */ export function add(a: v128, b: v128): v128; @@ -1416,9 +1416,9 @@ declare function i64x2(a: i64, b: i64): v128; declare namespace i64x2 { /** Creates a vector with two identical 64-bit integer lanes. */ export function splat(x: i64): v128; - /** Extracts one 64-bit integer lane as a scalar. */ + /** Extracts one 64-bit integer lane as a scalar. `idx` argument need to be compile time constant */ export function extract_lane(x: v128, idx: u8): i64; - /** Replaces one 64-bit integer lane. */ + /** Replaces one 64-bit integer lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: i64): v128; /** Adds each 64-bit integer lane. */ export function add(a: v128, b: v128): v128; @@ -1485,9 +1485,9 @@ declare function f32x4(a: f32, b: f32, c: f32, d: f32): v128; declare namespace f32x4 { /** Creates a vector with four identical 32-bit float lanes. */ export function splat(x: f32): v128; - /** Extracts one 32-bit float lane as a scalar. */ + /** Extracts one 32-bit float lane as a scalar. idx argument needs to be compile time constant. */ export function extract_lane(x: v128, idx: u8): f32; - /** Replaces one 32-bit float lane. */ + /** Replaces one 32-bit float lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: f32): v128; /** Adds each 32-bit float lane. */ export function add(a: v128, b: v128): v128; @@ -1575,9 +1575,9 @@ declare function f64x2(a: f64, b: f64): v128; declare namespace f64x2 { /** Creates a vector with two identical 64-bit float lanes. */ export function splat(x: f64): v128; - /** Extracts one 64-bit float lane as a scalar. */ + /** Extracts one 64-bit float lane as a scalar. idx argument needs to be compile time constant. */ export function extract_lane(x: v128, idx: u8): f64; - /** Replaces one 64-bit float lane. */ + /** Replaces one 64-bit float lane. idx argument needs to be compile time constant. */ export function replace_lane(x: v128, idx: u8, value: f64): v128; /** Adds each 64-bit float lane. */ export function add(a: v128, b: v128): v128;