Explicit SIMD support.
Use explicit vectors when SIMD execution is part of the algorithm: shuffles, transposes, prefix scans, fixed-tree reductions, gathers, compress, expand, or any loop that should run in vector lanes. simd.reducer accepts scalar contributions or explicit vector-plus-mask contributions, and simd.horizontal reduces a vector to one value.
Types
AlgebraicDotrecord
A dot product permitting reassociation and multiply-add contraction.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them. Ordinary Lua rounds each product before adding it; native lowering may fuse the two.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, left: T | simd.Vector<T, S>, right: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
left | T | simd.Vector<T, S> | |
right | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
AlgebraicProductrecord
A floating-point product whose named contract permits reassociation.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
AlgebraicSumrecord
A floating-point sum whose named contract permits reassociation.
Ordinary Lua has no lane width to exploit, so its executable reference uses a left fold. Native lowering may use several accumulators.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Allrecord
Whether every contribution is true; true for an empty loop.
Members
| Name | Kind | Description |
|---|
total | field | |
add | method | active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per... |
value | method | |
addmethod
add: function add<T, S>(self, value: boolean | simd.Mask<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so both masks are booleans; a fixed species contributes its lanes in order, each under its own lane of active.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | boolean | simd.Mask<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): boolean
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
AndBitsrecord
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
operation | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
operationmethod
operation: function(T, T): T
@private
Arguments
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Anyrecord
Whether any contribution is true; false for an empty loop.
Members
| Name | Kind | Description |
|---|
total | field | |
add | method | active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per... |
value | method | |
addmethod
add: function add<T, S>(self, value: boolean | simd.Mask<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so both masks are booleans; a fixed species contributes its lanes in order, each under its own lane of active.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | boolean | simd.Mask<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): boolean
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
CompensatedSumrecord
A floating-point sum carrying the rounding error each addition discards.
Ordered, pairwise and algebraic sums differ in how they associate, and each discards the low bits of every addition it makes. This one keeps them: the part that did not fit rides alongside the running total and is added back at the end, which recovers the totals an ordered sum loses entirely -- 1 +
1e100 + 1 - 1e100 returns two here and zero there.
Compensating is not the same as exact. The answer is enormously closer to the correctly rounded total than the other three, and like them it still depends on the order the contributions arrived in, which is why its contribution edges stay serial rather than being reassociated.
Neumaier's form rather than Kahan's: it compensates the larger operand as well as the smaller, so a large value added to a small running total does not lose its correction, which is the case plain Kahan gets wrong.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them. A float reducer keeps its total and its compensation in binary32.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
compensation | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
compensationfield
@private
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Countrecord
Counts true contributions exactly, modulo 2^64.
Members
| Name | Kind | Description |
|---|
total | field | |
add | method | active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per... |
value | method | |
addmethod
add: function add<T, S>(self, value: boolean | simd.Mask<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a mask that contribute, each lane's truth in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so both masks are booleans; a fixed species contributes its lanes in order, each under its own lane of active.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | boolean | simd.Mask<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Fixedinterface
sealed interface simd.Fixed<const N: integer>
A target-neutral fixed logical lane count.
Type parameters
IntegerArgMaxrecord
First one-based logical position of the integer extremum; zero when empty.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
IntegerArgMinrecord
First one-based logical position of the integer extremum; zero when empty.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
IntegerMaxrecord
An integer extremum including its initial value.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
IntegerMinrecord
An integer extremum including its initial value.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Maskinterface
sealed interface simd.Mask<T, S> ...
One predicate bit per lane of Vector<T, S>.
Type parameters
Members
| Name | Kind | Description |
|---|
__eq | metamethod | |
__unm | metamethod | |
select | method | |
any | method | |
all | method | |
count | method | |
first | method | Returns the first set lane, or zero when the mask is empty. |
bits | method | Returns lane bits in a uint64; bit zero denotes lane one. |
__eqmetamethod
__eq: function(left: simd.Mask<T, S>, right: simd.Mask<T, S>): simd.Mask<T, S>
Arguments
| Name | Type | Description |
|---|
left | simd.Mask<T, S> | |
right | simd.Mask<T, S> | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
__unmmetamethod
Arguments
| Name | Type | Description |
|---|
value | simd.Mask<T, S> | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
selectmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
whenTrue | simd.Vector<T, S> | T | |
whenFalse | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
anymethod
any: function(borrows self: simd.Mask<T, S>): boolean
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
Returns
allmethod
all: function(borrows self: simd.Mask<T, S>): boolean
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
Returns
countmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
Returns
firstmethod
first: function(borrows self: simd.Mask<T, S>): uint32
Returns the first set lane, or zero when the mask is empty.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
Returns
bitsmethod
bits: function(borrows self: simd.Mask<T, S>): uint64
Returns lane bits in a uint64; bit zero denotes lane one.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Mask<T, S> | |
Returns
NumberArgMaxrecord
First logical position, or zero when empty. A number wins over every NaN. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
NumberArgMinrecord
First logical position, or zero when empty. A number wins over every NaN. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
NumberMaxrecord
Floating extremum including the initial value; NaNs are canonicalized. A number wins over every NaN. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
NumberMinrecord
Floating extremum including the initial value; NaNs are canonicalized. A number wins over every NaN. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
OrBitsrecord
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
operation | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
operationmethod
operation: function(T, T): T
@private
Arguments
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
OrderedDotrecord
A dot product committed in logical iteration order without contraction.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them. Each product rounds before it is added.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, left: T | simd.Vector<T, S>, right: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
left | T | simd.Vector<T, S> | |
right | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
OrderedProductrecord
A floating-point product committed in logical iteration order.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
OrderedSumrecord
A floating-point sum committed in logical iteration order.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PairwiseDotrecord
A non-contracting dot product using the adjacent-pair sum tree.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them. Each product rounds before it joins the tree.
Type parameters
Members
| Name | Kind | Description |
|---|
sum | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, left: T | simd.Vector<T, S>, right: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
left | T | simd.Vector<T, S> | |
right | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PairwiseProductrecord
A floating-point product using the width-independent adjacent-pair tree.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
partials | field | |
count | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PairwiseSumrecord
A floating-point sum using the width-independent adjacent-pair tree.
T is the element it accumulates in: number is binary64, and float is binary32, each contribution and every operation's result rounded as nupp.math.f32 rounds them.
Type parameters
Members
| Name | Kind | Description |
|---|
partials | field | |
count | field | |
round | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
roundmethod
round: function(number): number
@private
Arguments
| Name | Type | Description |
|---|
? | number | |
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Preferredinterface
Target-selected native species identity.
PropagatingArgMaxrecord
First logical position, or zero when empty. A NaN wins over every number. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PropagatingArgMinrecord
First logical position, or zero when empty. A NaN wins over every number. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
position | field | |
count | field | |
add | method | active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that are candidates, in lane order, as one masked contribution per iteration of the do block around it. Lane i of the vector has logical position base + i, where base advances by the species' lane count for every vector contribution and by one for every scalar one, whether or not a lane was active. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each taking a position.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): integer
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PropagatingMaxrecord
Floating extremum including the initial value; NaNs are canonicalized. A NaN wins over every number. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
PropagatingMinrecord
Floating extremum including the initial value; NaNs are canonicalized. A NaN wins over every number. Signed zero follows -0 < +0.
T is the element: number or float. An extremum rounds nothing, so the two differ only in what a vector contribution is a vector of.
Type parameters
Members
| Name | Kind | Description |
|---|
best | field | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Reducerinterface
What every reducer shares: contributions go in through add, and value returns the finished reduction as a T.
What add takes depends on the family -- one value, two for a dot product, and an optional mask beside a vector -- so this names the member without fixing its parameters. Contribute through the concrete reducer; code that only finishes a reduction can take any Reducer<T>.
Type parameters
Members
| Name | Kind | Description |
|---|
add | method | Contributes to the reduction; the concrete reducer states its parameters. |
value | method | Returns the finished reduction. |
addmethod
@readonly
Contributes to the reduction; the concrete reducer states its parameters.
Arguments
Returns
valuemethod
@readonly
Returns the finished reduction.
Arguments
| Name | Type | Description |
|---|
self | simd.Reducer<T> | |
Returns
Speciesinterface
sealed interface simd.Species<T, S> ...
Operations whose lane count is selected from T and S at AOT lowering.
Type parameters
Members
| Name | Kind | Description |
|---|
lanes | field | |
convert | method | Converts each lane using LuaJIT FFI numeric conversion rules. |
reinterpret | method | Preserves every lane's bits. |
widen | method | The species of the next wider element of this one's family and signedness -- uint8 to uint16, int32 to int64, float... |
narrow | method | The species of the next narrower element with this species' lane count, the inverse of widen: a widened species... |
splat | method | |
iota | method | |
tail | method | |
mask | method | A mask of this species: every lane from one boolean, or lane for lane from another species' mask with the same lane... |
over | method | The chunks of a span of count elements, for a loop written once: for at, active in species:over(input) do ... |
map | method | A scalar operation on every lane: a closed-set math operation such as math.sqrt over a floating species, one of the... |
load | method | The next lanes of a span from offset, or one named field of its rows. |
store | method | Writes the next lanes of a span or one named field of its rows. |
loadPairs | method | The next 2 lanes elements from offset, dealt out a lane at a time: the first vector holds the elements at odd... |
loadTriples | method | The next 3 lanes elements, lane i of the jth vector reading element 3 (i - 1) + j of the run. |
loadQuads | method | The next 4 lanes elements, lane i of the jth vector reading element 4 (i - 1) + j of the run. |
storePairs | method | The inverse of loadPairs: 2 lanes elements from offset, alternating a lane of first with the same lane of second. |
storeTriples | method | The inverse of loadTriples. |
storeQuads | method | The inverse of loadQuads. |
gather | method | Reads one-based element indices. |
scatter | method | Writes one-based element indices, ignoring inactive or out-of-range lanes. |
scatterUnchecked | method | Asserts that all active indices are unique, without checking them. |
convertmethod
Converts each lane using LuaJIT FFI numeric conversion rules. Integer narrowing keeps low bits; float-to-integer truncates through int64, except uint64 which accepts the union of signed and unsigned ranges. Integer-to-float follows LuaJIT's double intermediate, including the possible double rounding when converting a 64-bit integer to float. NaN, infinities and out-of-range inputs have target-specific results, never undefined behavior. Both species must have the same lane count.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
value | simd.Vector<U, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
reinterpretmethod
Preserves every lane's bits. Element widths and lane counts must match.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
value | simd.Vector<U, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
widenmethod
widen: function<W>(borrows self: simd.Species<T, S>, wider: StorageWitness<W>): simd.Species<W, S>
The species of the next wider element of this one's family and signedness -- uint8 to uint16, int32 to int64, float to number -- with this species' logical lane count, named by the wider element's storage witness. A Fixed<N> species widens to the Fixed<N> species of that element. A Preferred one widens to a species holding as many lanes as its own register does, twice what the wider element's preferred species holds, so a widened vector occupies two native registers the way a Fixed<N> past one register does. It is the species a byte kernel converts into for a sum its bytes would overflow, without naming a register width:
local bytes = assert(simd.species(array.uint8))
local wide = bytes:widen(array.uint16)
local weighted = wide:convert(bytes:load(reds, at + 1)) * 77
The widened species keeps the checker's species identity S, so it reads as simd.Species<uint16, simd.Preferred>, the type simd.species(array.uint16) also has. They are different species once the function is lowered, one with the lane count of a uint8 register and the other with its own, and a vector of one meets a vector of the other only through convert, which is refused there when the counts differ. Nothing is wider than 64 bits: widening a 64-bit species is refused where the function is lowered, as is a witness that is not the next wider element.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
wider | StorageWitness<W> | |
Returns
narrowmethod
narrow: function<W>(borrows self: simd.Species<T, S>, narrower: StorageWitness<W>): simd.Species<W, S>
The species of the next narrower element with this species' lane count, the inverse of widen: a widened species narrows back to the species it came from, and a Preferred species narrows to one holding half the lanes the narrower element's own register does. Nothing is narrower than 8 bits.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
narrower | StorageWitness<W> | |
Returns
splatmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
value | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
iotamethod
iota: function(borrows self: simd.Species<T, S>, first: T, step: T): simd.Vector<T, S>
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
first | T | |
step | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
tailmethod
tail: function(borrows self: simd.Species<T, S>, active: integer): simd.Mask<T, S>
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
active | integer | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
maskmethod
A mask of this species: every lane from one boolean, or lane for lane from another species' mask with the same lane count, which is what carries a comparison of one element type to a select on another.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
value | boolean | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
overmethod
The chunks of a span of count elements, for a loop written once: for at, active in species:over(#input) do ... end visits every element from offset one, lanes at a time, binding at to the one-based offset of the chunk and active to its mask. Every chunk but the last is full, and an access under its mask is the unmasked one the loop's own bound proves; the last chunk's mask is the tail. Pass active to every load and store, and to every reducer contribution, and the loop is the whole strip-mined algorithm: no separate tail, no scalar continuation.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
count | integer | |
Returns
| Type | Description |
|---|
function(): (uint32?, simd.Mask<T, S>) | |
mapmethod
map: function(
borrows self: simd.Species<T, S>,
operation: function(...: any): T | number,
...: simd.Vector<T, S>
): simd.Vector<T, S>
A scalar operation on every lane: a closed-set math operation such as math.sqrt over a floating species, one of the corrected binary32 operations nupp.math.f32.fma, min and max over a float species, or a pure helper of this element taking one argument per vector. The operands must be locals.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
operation | function(...: any): T | number | |
... | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
loadmethod
load: function(
borrows self: simd.Species<T, S>,
borrows source: Span<T>,
offset: integer,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
& function<E>(
borrows self: simd.Species<T, S>,
borrows source: Span<E>,
offset: integer,
field: string,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
& function(
borrows self: simd.Species<T, S>,
borrows source: WriteSpan<T>,
offset: integer,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
& function<E>(
borrows self: simd.Species<T, S>,
borrows source: WriteSpan<E>,
offset: integer,
field: string,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
& function<E>(
borrows self: simd.Species<T, S>,
borrows source: SoaWriteToken & SoaWriteSpan<E>,
offset: integer,
field: string,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
& function(
borrows self: simd.Species<T, S>,
borrows source: SoaReadView,
offset: integer,
field: string,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
The next lanes of a span from offset, or one named field of its rows. A field in a span of structs is strided; a SoA row field is contiguous. active limits the lanes. The vector retains no storage borrow.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
borrows source | Span<E> | |
offset | integer | |
field | string | |
active | simd.Mask<T, S>? | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
storemethod
store: function(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
offset: integer,
value: simd.Vector<T, S>,
active: simd.Mask<T, S>?
): nil
& function<E>(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<E>,
offset: integer,
field: string,
value: simd.Vector<T, S>,
active: simd.Mask<T, S>?
): nil
& function<E>(
borrows self: simd.Species<T, S>,
exclusive destination: SoaWriteToken & SoaWriteSpan<E>,
offset: integer,
field: string,
value: simd.Vector<T, S>,
active: simd.Mask<T, S>?
): nil
Writes the next lanes of a span or one named field of its rows. Other fields are unchanged.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<E> | |
offset | integer | |
field | string | |
value | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
loadPairsmethod
loadPairs: function(
borrows self: simd.Species<T, S>,
borrows source: Span<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>)
& function(
borrows self: simd.Species<T, S>,
borrows source: WriteSpan<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>)
The next 2 * lanes elements from offset, dealt out a lane at a time: the first vector holds the elements at odd positions of the run and the second those at even ones, so interleaved pairs arrive as two vectors of their halves. Elements past the span read zero. The results initialize locals, local re, im = s:loadPairs(zs, at + 1).
On NEON this is one ld2; loadTriples and loadQuads are ld3 and ld4, which is what a three-byte or four-byte record costs to de-interleave there.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
borrows source | Span<T> | |
offset | integer | |
Returns
loadTriplesmethod
loadTriples: function(
borrows self: simd.Species<T, S>,
borrows source: Span<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>)
& function(
borrows self: simd.Species<T, S>,
borrows source: WriteSpan<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>)
The next 3 * lanes elements, lane i of the jth vector reading element 3 * (i - 1) + j of the run.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
borrows source | Span<T> | |
offset | integer | |
Returns
loadQuadsmethod
loadQuads: function(
borrows self: simd.Species<T, S>,
borrows source: Span<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>)
& function(
borrows self: simd.Species<T, S>,
borrows source: WriteSpan<T>,
offset: integer
): (simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>, simd.Vector<T, S>)
The next 4 * lanes elements, lane i of the jth vector reading element 4 * (i - 1) + j of the run.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
borrows source | Span<T> | |
offset | integer | |
Returns
storePairsmethod
storePairs: function(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
offset: integer,
first: simd.Vector<T, S>,
second: simd.Vector<T, S>
): nil
The inverse of loadPairs: 2 * lanes elements from offset, alternating a lane of first with the same lane of second. Elements past the span are not written.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<T> | |
offset | integer | |
first | simd.Vector<T, S> | |
second | simd.Vector<T, S> | |
Returns
storeTriplesmethod
storeTriples: function(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
offset: integer,
first: simd.Vector<T, S>,
second: simd.Vector<T, S>,
third: simd.Vector<T, S>
): nil
The inverse of loadTriples.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<T> | |
offset | integer | |
first | simd.Vector<T, S> | |
second | simd.Vector<T, S> | |
third | simd.Vector<T, S> | |
Returns
storeQuadsmethod
storeQuads: function(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
offset: integer,
first: simd.Vector<T, S>,
second: simd.Vector<T, S>,
third: simd.Vector<T, S>,
fourth: simd.Vector<T, S>
): nil
The inverse of loadQuads.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<T> | |
offset | integer | |
first | simd.Vector<T, S> | |
second | simd.Vector<T, S> | |
third | simd.Vector<T, S> | |
fourth | simd.Vector<T, S> | |
Returns
gathermethod
gather: function<I>(
borrows self: simd.Species<T, S>,
borrows source: Span<T>,
indices: simd.Vector<I, S>,
active: simd.Mask<T, S>?
): simd.Vector<T, S>
Reads one-based element indices. Inactive or out-of-range lanes return zero. Indices use int32, uint32, int64 or uint64 and must have the same logical lane count as this species at every emitted tier.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
borrows source | Span<T> | |
indices | simd.Vector<I, S> | |
active | simd.Mask<T, S>? | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
scattermethod
scatter: function<I>(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
indices: simd.Vector<I, S>,
value: simd.Vector<T, S>,
active: simd.Mask<T, S>?
): nil
Writes one-based element indices, ignoring inactive or out-of-range lanes. The compiler must prove that indices are unique; currently a directly supplied constant, non-wrapping iota provides that proof. No runtime collision check is emitted.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<T> | |
indices | simd.Vector<I, S> | |
value | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
scatterUncheckedmethod
scatterUnchecked: function<I>(
borrows self: simd.Species<T, S>,
exclusive destination: WriteSpan<T>,
indices: simd.Vector<I, S>,
value: simd.Vector<T, S>,
active: simd.Mask<T, S>?
): nil
Asserts that all active indices are unique, without checking them. Duplicate active indices are undefined behavior, even if the values agree. This promises no winning lane or accumulation order and does not authorize collisions between separate scatter operations. Bounds and inactive lanes behave as in scatter.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Species<T, S> | |
exclusive destination | WriteSpan<T> | |
indices | simd.Vector<I, S> | |
value | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
Vectorinterface
sealed interface simd.Vector<T, S> ...
An immutable register-as-data value.
Type parameters
Members
| Name | Kind | Description |
|---|
__add | metamethod | |
__sub | metamethod | |
__mul | metamethod | |
__div | metamethod | |
__mod | metamethod | % and // are Lua's: the remainder takes the divisor's sign and the quotient rounds toward negative infinity, lane by... |
__unm | metamethod | |
__eq | metamethod | |
__lt | metamethod | |
__le | metamethod | |
propagatingMin | method | The smaller of each lane pair, and the larger, under the contract the name selects. |
propagatingMax | method | |
numberMin | method | numberMin returns the operand that is not NaN, and the canonical NaN only when both are, which is IEEE-754's minNum. |
numberMax | method | |
fma | method | self multiplier + addend with one rounding per lane: the product is exact and only the sum rounds, so the two-step... |
saturatingAdd | method | self + other and self - other clamped to the element's range rather than wrapped: a byte that would reach 300... |
saturatingSub | method | |
popcount | method | The number of one bits in each lane's two's complement representation at the element's width, so -1 on a signed byte... |
mulHigh | method | The high half of each lane's full-width product: the bits above the element's width of self other taken at twice... |
extract | method | Lane indices are one-based and decided when the function is lowered: a literal, the species' lanes, or +, - and over... |
insert | method | |
reverse | method | Reverses logical lane order. |
interleave | method | Alternates lanes from self and other, then splits that sequence into two species-width results. |
deinterleave | method | Returns the odd and even lanes of self followed by other. |
rotateLeft | method | Rotates logical lanes. |
rotateRight | method | |
align | method | Selects a species-width window from previous .. |
swizzle | method | Every lane read from another lane this vector names at run time. |
compress | method | Packs selected lanes toward lane one and zeroes the remainder. |
expand | method | Distributes packed lanes into selected positions and zeroes the rest. |
orderedPrefixSum | method | Inclusive, logical-lane-order prefix operations. |
prefixXor | method | |
__addmetamethod
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__submetamethod
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__mulmetamethod
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__divmetamethod
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__modmetamethod
% and // are Lua's: the remainder takes the divisor's sign and the quotient rounds toward negative infinity, lane by lane, as a - floor(a
/ b) * b and floor(a / b) on a floating species and exactly on an integer one. An integer lane divided by zero returns zero, as / does, rather than trapping.
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__unmmetamethod
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
__eqmetamethod
__eq: function(left: simd.Vector<T, S>, right: simd.Vector<T, S> | T): simd.Mask<T, S>
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
__ltmetamethod
__lt: function(left: simd.Vector<T, S>, right: simd.Vector<T, S> | T): simd.Mask<T, S>
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
__lemetamethod
__le: function(left: simd.Vector<T, S>, right: simd.Vector<T, S> | T): simd.Mask<T, S>
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Mask<T, S> | |
propagatingMinmethod
The smaller of each lane pair, and the larger, under the contract the name selects. There is no unqualified min: the two disagree on every pair containing a NaN, and which one a program wanted is not recoverable from the call.
propagatingMin returns the canonical NaN whenever either operand is NaN, which is nupp.math.f32.min's contract and what makes a reduction built on it independent of which lane the NaN landed in and of how many lanes the target chose. -0 is the smaller zero and +0 the larger, so an equal pair of zeros is ordered by sign rather than by position. -inf and +inf are ordinary values at the ends of the order.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
propagatingMaxmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
numberMinmethod
numberMin returns the operand that is not NaN, and the canonical NaN only when both are, which is IEEE-754's minNum. It is the contract for a scan looking for the smallest real measurement in data that carries NaN for a missing one. Zeros and infinities behave as they do above.
A reduction over it depends on how many lanes were NaN, which is the price of ignoring them and the reason it is not the default.
An integer element has no NaN, so the two contracts coincide there and either spelling returns the same value.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
numberMaxmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
fmamethod
self * multiplier + addend with one rounding per lane: the product is exact and only the sum rounds, so the two-step form's second rounding, and its overflow in a product the sum would have brought back, do not happen. On a float species this is nupp.math.f32.fma's contract, the binary64 fused operation on a number one, and a NaN lane returns the canonical NaN either way. A floating species only; an integer product has nothing to round.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
multiplier | simd.Vector<T, S> | T | |
addend | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
saturatingAddmethod
saturatingAdd: function(borrows self: simd.Vector<T, S>, other: simd.Vector<T, S> | T): simd.Vector<T, S>
self + other and self - other clamped to the element's range rather than wrapped: a byte that would reach 300 returns 255, and an unsigned lane taken below zero returns zero. An integer species only.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
saturatingSubmethod
saturatingSub: function(borrows self: simd.Vector<T, S>, other: simd.Vector<T, S> | T): simd.Vector<T, S>
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
popcountmethod
popcount: function(borrows self: simd.Vector<T, S>): simd.Vector<T, S>
The number of one bits in each lane's two's complement representation at the element's width, so -1 on a signed byte returns 8. An integer species only.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
mulHighmethod
mulHigh: function(borrows self: simd.Vector<T, S>, other: simd.Vector<T, S> | T): simd.Vector<T, S>
The high half of each lane's full-width product: the bits above the element's width of self * other taken at twice that width, signed or unsigned as the element is. * returns the low half, so the two together are the whole product; alone, this is the fixed-point multiply, (a * b) >> bits, that a scaled reciprocal turns a division into. An integer species only.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
insertmethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
lane | integer | |
value | T | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
reversemethod
reverse: function(borrows self: simd.Vector<T, S>): simd.Vector<T, S>
Reverses logical lane order.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
interleavemethod
interleave: function(
borrows self: simd.Vector<T, S>,
other: simd.Vector<T, S>
): (simd.Vector<T, S>, simd.Vector<T, S>)
Alternates lanes from self and other, then splits that sequence into two species-width results. No lane bits are changed.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | |
Returns
deinterleavemethod
deinterleave: function(
borrows self: simd.Vector<T, S>,
other: simd.Vector<T, S>
): (simd.Vector<T, S>, simd.Vector<T, S>)
Returns the odd and even lanes of self followed by other. This is the inverse of interleave, including for odd logical lane counts.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
other | simd.Vector<T, S> | |
Returns
rotateLeftmethod
rotateLeft: function(borrows self: simd.Vector<T, S>, count: integer): simd.Vector<T, S>
Rotates logical lanes. Counts are reduced modulo the species width.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
count | integer | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
rotateRightmethod
rotateRight: function(borrows self: simd.Vector<T, S>, count: integer): simd.Vector<T, S>
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
count | integer | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
alignmethod
align: function(borrows self: simd.Vector<T, S>, previous: simd.Vector<T, S>, offset: integer): simd.Vector<T, S>
Selects a species-width window from previous .. self. Offset zero returns self; positive offsets bring trailing lanes of previous into the beginning. The offset is decided when the function is lowered, on the terms extract's lane is, and one past the lanes returns previous whole.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
previous | simd.Vector<T, S> | |
offset | integer | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
swizzlemethod
swizzle: function(
borrows self: simd.Vector<T, S>,
indices: simd.Vector<T, S>,
other: simd.Vector<T, S>?,
third: simd.Vector<T, S>?,
fourth: simd.Vector<T, S>?
): simd.Vector<T, S>
Every lane read from another lane this vector names at run time.
Lane i returns self:extract(indices:extract(i)), and zero where that index is outside 1..lanes. Zero rather than a refusal because the native instructions return zero for an out-of-range byte and a check per lane would cost more than the lookup.
This is the table lookup: a table is a vector, so there is no table type and no constructor taking one entry per argument. A sixteen-entry byte table is a Fixed<16> vector of constants, or a preferred-width one with those sixteen entries repeated, and looking up in it is this.
With other, the lanes of both are numbered in one run: an index in 1..lanes reads self and one in lanes+1..2*lanes reads other. That is the shape align needs and one vector cannot reach, and it is what makes this one operation rather than a family of them. third and fourth continue the run to three and four tables, which is how a 64-entry byte table on a sixteen-lane species is one lookup. They are optional on the same terms load's mask is. An index a lane cannot hold -- past 255 for bytes -- is not reachable.
The indices are read as lane numbers, so the element must be an integer one. A float vector has no lane numbering to offer.
Arguments
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
compressmethod
compress: function(borrows self: simd.Vector<T, S>, selected: simd.Mask<T, S>): simd.Vector<T, S>
Packs selected lanes toward lane one and zeroes the remainder.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
selected | simd.Mask<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
expandmethod
expand: function(borrows self: simd.Vector<T, S>, selected: simd.Mask<T, S>): simd.Vector<T, S>
Distributes packed lanes into selected positions and zeroes the rest.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
selected | simd.Mask<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
orderedPrefixSummethod
orderedPrefixSum: function(borrows self: simd.Vector<T, S>): simd.Vector<T, S>
Inclusive, logical-lane-order prefix operations. The ordered sum adds lanes from the first, the way orderedSum does.
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
prefixXormethod
Arguments
| Name | Type | Description |
|---|
borrows self | simd.Vector<T, S> | |
Returns
| Type | Description |
|---|
simd.Vector<T, S> | |
WrappingProductrecord
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
operation | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
operationmethod
operation: function(T, T): T
@private
Arguments
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
WrappingSumrecord
Fixed-width reducers name their element with its array witness, as a species does. Their initial value participates in the fold. Narrow storage loads contribute to i32 or u32; i64 and u64 never pass through a Lua double.
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
operation | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
operationmethod
operation: function(T, T): T
@private
Arguments
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
XorBitsrecord
Type parameters
Members
| Name | Kind | Description |
|---|
total | field | |
operation | method | |
add | method | active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the... |
value | method | |
operationmethod
operation: function(T, T): T
@private
Arguments
Returns
addmethod
add: function add<S>(self, value: T | simd.Vector<T, S>, active: simd.Mask<T, S>?): nil
active selects the lanes of a vector that contribute, in lane order, as one masked contribution per iteration of the do block around it. As ordinary Lua a preferred species is one lane wide, so the vector is that lane's value and the mask a boolean; a fixed species contributes its lanes in order, each under its own lane of the mask.
Arguments
| Name | Type | Description |
|---|
self | any | |
value | T | simd.Vector<T, S> | |
active | simd.Mask<T, S>? | |
Returns
valuemethod
value: function value(self): T
Arguments
| Name | Type | Description |
|---|
self | any | |
Returns
Functions
horizontal.algebraicDotfunction
As ordinary Lua the vectors are one lane each, which is the product.
Type parameters
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | |
Returns
horizontal.algebraicProductfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.algebraicSumfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.andBitsfunction
The bitwise and of every lane of an integer vector. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.integerMaxfunction
The largest lane of an integer vector, by the element's signedness. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.integerMinfunction
The smallest lane of an integer vector, by the element's signedness. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.numberArgMaxfunction
As ordinary Lua a preferred-species vector is one lane, which is the position; a fixed-species vector is searched.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.numberArgMinfunction
As ordinary Lua a preferred-species vector is one lane, which is the position; a fixed-species vector is searched.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.numberMaxfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.numberMinfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.orBitsfunction
The bitwise or of every lane of an integer vector. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.orderedDotfunction
As ordinary Lua the vectors are one lane each, which is the product.
Type parameters
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | |
Returns
horizontal.orderedProductfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.orderedSumfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.pairwiseDotfunction
As ordinary Lua the vectors are one lane each, which is the product.
Type parameters
Arguments
| Name | Type | Description |
|---|
left | simd.Vector<T, S> | |
right | simd.Vector<T, S> | |
Returns
horizontal.pairwiseProductfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.pairwiseSumfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.propagatingArgMaxfunction
As ordinary Lua a preferred-species vector is one lane, which is the position; a fixed-species vector is searched.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.propagatingArgMinfunction
The one-based lane holding the matching reduction's answer.
The lowest such lane when several tie, which is the logical-index tie rule every lane-selecting operation here uses. propagatingArgMin returns the lowest NaN lane when any lane is NaN, because that is the lane whose element is what propagatingMin returns; numberArgMin skips NaN lanes and returns the lowest only when every lane is NaN. Either way the identity value:extract(horizontal.<name>ArgMin(value)) holds against the reduction of the same name.
A lane index rather than a lane and its value, because an AOT expression returns a value and extract already spells the pair. As ordinary Lua a preferred-species vector is one lane, which is the position; a fixed-species vector is searched.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.propagatingMaxfunction
As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.propagatingMinfunction
The smallest lane, and the largest, under the contract the name selects.
These take no order where the sums and products above take three: min and max round nothing, so every association of them returns the same value and three names would have named one answer. What they do take is the NaN contract, for the same reason Vector.propagatingMin and Vector.numberMin are separate names -- and each is the elementwise operation of that name, folded over the lanes.
propagatingMin returns the canonical NaN when any lane is NaN, so its answer does not depend on how many lanes the target chose. numberMin returns the smallest lane that is not NaN, and the canonical NaN only when every lane is. -0 is the smaller zero under both. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.wrappingProductfunction
The lanes of an integer vector multiplied, wrapping in the lane's width. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.wrappingSumfunction
The lanes of an integer vector summed, wrapping in the lane's own width: a byte vector's sum wraps at a byte, as simd.reducer.wrappingSum wraps at its element. Every association returns the same, so there is one name. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
horizontal.xorBitsfunction
The bitwise exclusive or of every lane of an integer vector. As ordinary Lua a preferred-species vector is one lane, which is the reduction; a fixed-species vector is folded.
Type parameters
Arguments
| Name | Type | Description |
|---|
value | simd.Vector<T, S> | |
Returns
lane.binaryfunction
Arguments
| Name | Type | Description |
|---|
op | string | |
element | string | |
a | any | |
b | any | |
Returns
Raises
| Type | Condition |
|---|
string | when the operator is not one the lanes have |
lane.fromStoragefunction
The N-lane vector a stored Fixed<N> field holds: storage is the field's C array, lane i at index i - 1, each wrapped to the element as a load wraps it. Writing the field back is the assignment itself, since the FFI copies an N-lane table into an N-element array.
Arguments
| Name | Type | Description |
|---|
element | string | |
n | integer | |
storage | any | |
Returns
lane.methodfunction
Arguments
| Name | Type | Description |
|---|
name | string | |
element | string | |
receiver | any | |
... | any | |
Returns
Raises
| Type | Condition |
|---|
string | when the method is not one the lanes have |
lane.unaryfunction
function lane.unary(op: string, element: string, a: any): any
Arguments
| Name | Type | Description |
|---|
op | string | |
element | string | |
a | any | |
Returns
reducer.allfunction
function reducer.all(): simd.All
Constructs an all reducer.
Returns
reducer.andBitsfunction
Constructs a bitwise and over element, including the supplied initial value.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.anyfunction
function reducer.any(): simd.Any
Constructs an any reducer.
Returns
reducer.countfunction
Constructs a count reducer.
Returns
| Type | Description |
|---|
simd.Count | |
reducer.integerArgMaxfunction
Constructs an integer argmax reducer.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
Returns
reducer.integerArgMinfunction
Constructs an integer argmin reducer.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
Returns
reducer.integerMaxfunction
Constructs an integer max reducer.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.integerMinfunction
Constructs an integer min reducer.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.orBitsfunction
Constructs a bitwise or over element, including the supplied initial value.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.wrappingProductfunction
Constructs a wrapping product over element, including the supplied initial value.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.wrappingSumfunction
Constructs a wrapping sum over element, including the supplied initial value.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
reducer.xorBitsfunction
Constructs a bitwise exclusive or over element, including the supplied initial value.
Type parameters
Arguments
| Name | Type | Description |
|---|
element | StorageWitness<T> | |
initial | Given(T) | |
Returns
transposefunction
Transposes a square tile of Fixed row vectors into N column vectors. All rows have the same element type; lane bits are preserved. Results are separate native vectors, not a table, and cannot escape the AOT kernel.
Type parameters
Arguments
| Name | Type | Description |
|---|
... | Rows... | |
Returns