README

marianoguerra/wax/wasm/simd does not have a README file

#
Imm

pub(all) enum Imm {
NoImm
Lane(Shape)
Shuffle
} derive(Eq,
Debug
)

What constant immediates an intrinsic takes after its operands.

#
Intrinsic

pub struct Intrinsic {
operands : Array[Ty]
result : Ty?
imm : Imm
free : Bool
build : (Array[Int]) ->
Instruction

}

What a vector intrinsic takes, gives back, and builds.

#
LaneWidth

pub(all) enum LaneWidth {
L8
L16
L32
L64
} derive(Eq, Hash,
Debug
)

The lane width a load8_lane-style name carries.

#
LaneWidth::nat_align

fn LaneWidth::nat_align(self : LaneWidth) -> Int

The alignment such an access naturally has, in bytes.

#
LaneWidth::to_str

fn LaneWidth::to_str(self : LaneWidth) -> String

#
MemIntrinsic

pub struct MemIntrinsic {
operands : Array[Ty]
result : Ty?
lane : Bool
nat_align : Int
build : (Int, Int, Int64, Int) ->
Instruction

}

What a vector memory method takes, gives back, and builds.

#
Shape

pub(all) enum Shape {
I8x16
I16x8
I32x4
I64x2
F32x4
F64x2
} derive(Eq, Hash,
Debug
)

A lane shape: how the 128 bits are divided, and into what.

#
Shape::is_float

fn Shape::is_float(self : Shape) -> Bool

Is this shape's lane a float?

#
Shape::lane_count

fn Shape::lane_count(self : Shape) -> Int

How many lanes the shape has. Also the number of literals a constant of that shape takes, and the exclusive bound on a lane index.

#
Shape::lane_scalar

fn Shape::lane_scalar(self : Shape) -> Ty

The scalar type of one lane: what splat takes, what extract gives back, and what replace puts in.

The narrow integer shapes work in i32, because wasm has no narrower scalar.

#
Shape::of_str

fn Shape::of_str(s : String) -> Shape?

#
Shape::to_str

fn Shape::to_str(self : Shape) -> String

pub(all) enum Ty {
TV128
TI32
TI64
TF32
TF64
} derive(Eq, Hash,
Debug
)

The operand and result types a vector intrinsic deals in.

Kept apart from both the Wax and the wasm value-type representations, so each consumer maps it to its own rather than this module picking one.

#
VecLoad

pub(all) enum VecLoad {
Load128
Load8x8S
Load8x8U
Load16x4S
Load16x4U
Load32x2S
Load32x2U
Load32Zero
Load64Zero
} derive(Eq, Hash,
Debug
)

The whole-vector loads, each of which reads a differently shaped chunk and widens or zero-fills it.

#
VecLoad::nat_align

fn VecLoad::nat_align(self : VecLoad) -> Int

How many bytes the load actually reads -- which is not always 16, and is what its natural alignment follows from.

#
VecLoad::to_str

fn VecLoad::to_str(self : VecLoad) -> String

#
all_shapes

let all_shapes : Array[Shape]

#
bitselect_name

let bitselect_name : String

#
classify

fn classify(name : String) -> Intrinsic?

The intrinsic of this name, if there is one.

#
const_arity

fn const_arity(s : Shape) -> Int

How many lane literals a constant of this shape takes.

#
const_name

fn const_name(s : Shape) -> String

A constant is named for its shape: v128_i32x4(1, 2, 3, 4).

#
const_shape_of_name

fn const_shape_of_name(name : String) -> Shape?

The shape a v128_<shape> constant name denotes, if the name is one.

#
float_shapes

let float_shapes : Array[Shape]

#
free_full

fn free_full(part : String) -> String

The full name of a free intrinsic, from its member part.

#
free_member

fn free_member(full : String) -> String?

The member part of a full free-intrinsic name, if it is one.

#
free_member_names

let free_member_names : Array[String]

Every free intrinsic's member name, for completion after v128_.

#
free_namespace

let free_namespace : String

The namespace the free vector intrinsics live in.

#
int_shapes

let int_shapes : Array[Shape]

#
is_free_intrinsic

fn is_free_intrinsic(name : String) -> Bool

Is this the name of a free intrinsic -- a constant, or bitselect?

#
is_mem_method

fn is_mem_method(name : String) -> Bool

#
lane_widths

let lane_widths : Array[LaneWidth]

#
load_lane_name

fn load_lane_name(w : LaneWidth) -> String

#
load_splat_name

fn load_splat_name(w : LaneWidth) -> String

#
mem_method

fn mem_method(name : String) -> MemIntrinsic?

The vector memory method of this name, if there is one.

#
mem_method_names

let mem_method_names : Array[String]

Every vector memory method name, for completion after mem.. Exactly the set mem_method recognises, because both are built from the same lists.

#
method_names

fn method_names(recv : Ty) -> Array[String]

Every method intrinsic whose receiver has this type, sorted.

The receiver is the first operand, which is what makes "the methods on a v128" answerable at all -- a free function has no receiver and is excluded.

#
size

fn size() -> Int

How many operations the registry holds.

#
store_lane_name

fn store_lane_name(w : LaneWidth) -> String

#
store_name

let store_name : String

#
vec_loads

let vec_loads : Array[VecLoad]

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io