Skip to main content

Module compare

Module compare 

Source
Expand description

Comparison and selection nodes.

Two families:

  • Comparison (u64_eq, u64_lt, f64_lt, …): two-input nodes that produce a u64 truth value (0 or 1). The DSL’s ==, !=, <, >, <=, >= infix operators desugar to these — type-aware dispatch in compile_binding picks the u64_* or f64_* variant based on operand types.

  • Selection (select_u64, select_f64): three-input nodes that pick between two operand values based on a u64 condition (any nonzero → first arg, zero → second). Used to desugar if(cond, a, b) once the compiler knows the result type. Both branches always evaluate — no short-circuit. JIT level: P2 (compiled closure; could become a P3 conditional select in a future pass).

Output of every comparison node is u64 so downstream code can mix them with bitwise operators (a < b & c < d) without widening, and pass them as the cond input to select_*.

Structs§

F64Eq
The f64_eq node.
F64Ge
The f64_ge node.
F64Gt
The f64_gt node.
F64Le
The f64_le node.
F64Lt
The f64_lt node.
F64Ne
The f64_ne node.
SelectF64
Pick between two f64 inputs based on a u64 condition. f64s travel as raw u64 bit patterns through the compiled buffer.
SelectStr
Pick between two String inputs based on a u64 condition. Any nonzero conda; zero → b.
SelectU64
Pick between two u64 inputs based on a u64 condition.
StrEq
Equality of two String wires. Returns 1 if equal else 0.
StrNe
Inequality of two String wires.
U64Eq
The u64_eq node.
U64Ge
The u64_ge node.
U64Gt
The u64_gt node.
U64Le
The u64_le node.
U64Lt
The u64_lt node.
U64Ne
The u64_ne node.