You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes the float-typed op gap from Path A.2. Previously the OMC
bytecode compiler emitted plain Op::Div + Op::Eq/Ne/Lt/etc
regardless of operand types, so the JIT (which trusts the typed
op) treated float bit-patterns as int and produced garbage on
anything beyond Add/Sub/Mul.
What's new:
- Op::DivFloat in bytecode.rs (compiler emits when both operands
are statically typed-float)
- Op::EqFloat / NeFloat / LtFloat / LeFloat / GtFloat / GeFloat
for the comparison family
- Compiler specialization in Expression::Div, Eq, Ne, Lt, Le,
Gt, Ge — uses existing infer_type to choose Op::*Float when
both sides are float-typed
- VM handlers in vm.rs: DivFloat returns Singularity on /0
(matches Op::Div semantics); comparisons inline as direct
f64 comparisons
- JIT scalar lowerer: DivFloat via bin_float, comparisons via
new cmp_op_float helper using FloatPredicate (OEQ/ONE/OLT/etc)
- JIT dual-band lowerer: same ops via bin_vec_float +
cmp_vec_float, parallel-lane <2 x f64> bitcast
- disasm.rs: pretty-print mnemonics for the new ops
Test added (5 in jit_floats now, all passing):
- float_div_and_compare_in_jit: harmonic_x1000(n) = floor(H_n * 1000)
using `1.0 / to_float(k)` in a loop. Previously failed in JIT
because Op::Div was integer-coercing; now H_10 = 2929 matches the
closed-form value.
Workspace: 42 codegen tests pass (was 41), 149 core unit tests pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments