Fix value-loss bug introduced as a #122 boundary in the float arr[i]=v store: when the index sub-expr clobbers X0 (e.g. `a[geti()]=1.5f32`), the value is lost. Mirror the scalar-deref X0-spill template (cstage cgen.c:4187; line shifted from the brief's stale :3859 cite by intervening #133/#135/#138 commits): for float element only, replace PUSHQ AX (junk for floats — value is in X0) with SUBQ $8,SP + MOVSS/MOVSD X0,(SP) before the idx/base eval; mirror replace POPQ AX with MOVSS/MOVSD (SP),X0 + ADDQ $8,SP after. Wwstage parallel. Non-float keeps PUSHQ/POPQ AX so the str/slice 3-word {ptr,len,cap} pop order at the end of the branch is preserved. #122 trailing-store comment updated from "Deferred to #125" to a positive cite. Test 916: 5 rows — f64_call_index + f32_call_index canonical repros (geti's body clobbers X0; pre-fix exit=2 from post-call residue, post-fix exit=1 from the spilled 1.5) + f64_lit_index / _localvar / _arith control rows for non-X0-clobbering index paths. f32_call_index uses an int-arg call to dodge the sibling cs/ww f32-arg-push MOVSD-vs-MOVSS divergence (#143, task #36 — orthogonal, filed). Bootstrap NEUTRAL (zero current float arr[i]= callers in lib; only [N]u8 byte-buffers like f64tos_buf). cs==ww byte-identical both stages (990-997 + 916 inline cmp). Closes the #122 boundary-doc loose end; completes the #122 family.
52 KiB
52 KiB