fold-2 chunk C4 (drew's Fam8-13 plan): 13 float value-row C drivers re-homed. 11 migrate to test/lang/*_test.ww @test row-tables (exact IEEE-bit asserts); 1 float-overflow reject row -> a runww //ww:error carrier. 956_tuprecv_f64 slims to a w6c_ww asserttyped pin (20 value rows -> @test; the stamp dimension can't be a value/byte-id @test) -- mutation-proven non-vacuous (break #121 stamp -> RED 6/6 -> restore -> GREEN) + an in-test vacuity self-check. 946_structparam/structret stay whole: their SSE register-class .s-grep (SysV ABI conformance, #165/#171a) is the genuine defect-guard, not @test-expressible. Float was the predicted SSE-cursor byte-id hotspot -- zero fresh cs!=ww surfaced; 951_f64cgen (cstage-only before) byte-ids clean. LANGBYTEID floor 82->93; test count 384->374 (10 deleted drivers; 956 + the 2 946 kept).
56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
// f64xmm_test — f64 XMM materialise + tuple .0 compare, migrated from
|
|
// test/wcc/955_f64xmm_run.c (#5-C4, #103). Two GATE-BLIND faces (both stages
|
|
// emitted byte-identical-but-wrong asm, so byte-id never catches a reintroduction
|
|
// — the T1 cstage run is the live net):
|
|
// FACE X — a no-decimal float-typed integer literal (`0f64`, `8f64`) is an
|
|
// N_INTLIT carrying float TYPE; the integer-immediate path stranded it in
|
|
// AX, so `n == 0f64` compared a stale X0 and `(8f64 * 10.0): i32` read
|
|
// garbage. Fixed by routing the float-typed N_INTLIT through the float-
|
|
// constant-in-X0 emit (+ the wwstage exprfloatkind N_INTLIT arm).
|
|
// FACE Z — a tuple positional f64 field read (`r.0`, r:(f64,i64)) loaded via
|
|
// the integer op into AX, so `r.0 == 0.0` was wrongly true. Fixed by a
|
|
// fld_isfloat branch -> MOVSD/MOVSS into X0.
|
|
|
|
package f64xmm_test;
|
|
|
|
fn g0(n: f64) i32 = { if (n == 0f64) { return 1; }; return 0; };
|
|
|
|
fn gneg(n: f64) i32 = { if (n == -8f64) { return 1; }; return 0; };
|
|
|
|
fn norm(n: f64) (f64, i64) = { return (n, 0); };
|
|
|
|
@test fn x_cmp_false() void = {
|
|
assert(g0(8.0) == 0);
|
|
};
|
|
|
|
@test fn x_cmp_true() void = {
|
|
assert(g0(0.0) == 1);
|
|
};
|
|
|
|
@test fn x_arith() void = {
|
|
assert((8f64 * 10.0): i32 == 80);
|
|
};
|
|
|
|
// `-8f64` is N_UN(TK_MINUS) over a float-typed N_INTLIT — the wwstage
|
|
// exprfloatkind must recurse through the unary into the N_INTLIT-float arm.
|
|
@test fn x_neg_cmp_true() void = {
|
|
assert(gneg(-8.0) == 1);
|
|
};
|
|
|
|
@test fn x_neg_cmp_false() void = {
|
|
assert(gneg(8.0) == 0);
|
|
};
|
|
|
|
// FACE Z: r.0 == 0.0 with r = (8.0, 0) must be false (bug: wrongly true).
|
|
@test fn z_tuple_field() void = {
|
|
const r = norm(8.0);
|
|
assert(r.0 != 0.0);
|
|
};
|
|
|
|
// CONTROL: the let-bound spelling was already correct and must stay correct.
|
|
@test fn z_letbound_control() void = {
|
|
const r = norm(8.0);
|
|
const m = r.0;
|
|
assert(m != 0.0);
|
|
};
|