Expand description
Register-plane nodes — 128-bit SIMD words as values (type_system_alignment.md §8.4 layer 2).
A register word is a plain 16-byte value with a lane-typed or
raw view (polydat::ast::RegLanes). Views are free bitcasts:
the RegView adapter (auto-inserted by the assembler for
any reg→reg wire) retags without touching bits, so a word can
be [i64; 2] for one op, [u8-ish bytes] for a shuffle, and
algorithm-defined raw state for a third — at zero cost.
Families here:
- Splats — float lanes from
f64(exact for f32 lanes in range), integer lanes from au64bit-level constructor (k as iNper lane; range semantics belong to the adapter system, constructors are bit tools). - Gather / conversions —
[f32; 4]↔vec_f32and a bounds-checked window gather from a slice. - Lane access — get/set for f32 lanes, reads for i16/i64.
- Element-wise arithmetic — add/sub/mul across every lane family; integer ops wrap (lane arithmetic is modular, the range-checked story lives in scalar adapters).
reg_dot_f32— horizontal dot with a FIXED reduction tree((l0+l1) + (l2+l3)), part of the op contract so results are reproducible everywhere (determinism D2).reg_shuffle_bytes— arbitrary byte permutation of the raw word from a 16-entry const mask (the SWAR/state-word workhorse).
Structs§
- RegAdd
F32 - The
reg_add_f32node. - RegAdd
F64 - The
reg_add_f64node. - RegAdd
I8 - The
reg_add_i8node. - RegAdd
I16 - The
reg_add_i16node. - RegAdd
I32 - The
reg_add_i32node. - RegAdd
I64 - The
reg_add_i64node. - RegDot
F32 reg_dot_f32(a, b)— horizontal dot product with the FIXED reduction tree(l0*r0 + l1*r1) + (l2*r2 + l3*r3). The tree shape is part of the contract (determinism D2): every host and every execution tier produces bit-identical results.- RegGather
F32 reg_gather_f32(v, offset)— load lanes[offset, offset+4)of an f32 slice into a register word. Panics when the window runs past the end (silent zero-fill would corrupt distance math downstream).- RegLane
F32 reg_lane_f32(r, i)— read lanei(0..4), widened to f64.- RegLane
I16 reg_lane_i16(r, i)— read lanei(0..8).- RegLane
I64 reg_lane_i64(r, i)— read lanei(0..2).- RegMul
F32 - The
reg_mul_f32node. - RegMul
F64 - The
reg_mul_f64node. - RegMul
I8 reg_mul_i8(a, b)— the wrapping product per lane. x86 has no byte-lane multiply short of AVX-512 and Cranelift lowers none, so native code runs this body through a helper.- RegMul
I16 - The
reg_mul_i16node. - RegMul
I32 - The
reg_mul_i32node. - RegMul
I64 - The
reg_mul_i64node. - RegShuffle
Bytes reg_shuffle_bytes(x, mask)— arbitrary byte permutation of the raw word: output byteiis input bytemask[i]. The mask is a 16-entry const list, each entry < 16 (panic otherwise, at build time). Duplicate indices broadcast; this is the SWAR / state-word workhorse for lane rearrangement under any view. Native code bakes the mask into oneshuffleinstruction, so the node exposes it as its constants.- RegSplat
F32 reg_splat_f32(k)— broadcastk(applied at f32 precision) into all four f32 lanes.- RegSplat
F64 reg_splat_f64(k)— broadcastkinto both f64 lanes.- RegSplat
I8 reg_splat_i8(k)— bit-level broadcast: each lane isk as i8.- RegSplat
I16 reg_splat_i16(k)— bit-level broadcast: each lane isk as i16.- RegSplat
I32 reg_splat_i32(k)— bit-level broadcast: each lane isk as i32.- RegSplat
I64 reg_splat_i64(k)— bit-level broadcast: each lane isk as i64.- RegSub
F32 - The
reg_sub_f32node. - RegSub
F64 - The
reg_sub_f64node. - RegSub
I8 - The
reg_sub_i8node. - RegSub
I16 - The
reg_sub_i16node. - RegSub
I32 - The
reg_sub_i32node. - RegSub
I64 - The
reg_sub_i64node. - RegTo
VecF32 reg_to_vec_f32(r)— the inverse projection.- RegView
- Pass-through guard that retags a register word’s view. The
bits are untouched — this is the materialized form of “views
are free bitcasts” for intra-graph wires whose producer and
consumer declare different lane typings. Auto-inserted by
compile::assembly::auto_adapterfor every reg→reg pair; rarely instantiated by hand. - RegWith
Lane F32 reg_with_lane_f32(r, i, v)— copy ofrwith laneireplaced byv(at f32 precision).- VecTo
RegF32 vec_to_reg_f32(v)— a length-4vec_f32IS areg_f32x4; panics on any other length.
Functions§
- gather_
f32 - The word of lanes
[offset, offset+4)ofv; panics past the end. - is_
reg_ port truewhentis any register-plane PortType.- lane_
f32 - Lane
iofras f32 lanes, widened. - lane_
i16 - Lane
iofras i16 lanes. - lane_
i64 - Lane
iofras i64 lanes. - mul_i8
- The wrapping product of
aandbas i8 lanes. - to_
reg_ f32 - The word of a four-element
v. - with_
lane_ f32 rwith f32 laneireplaced byv.