Skip to content

feat(t27b): f64 in AArch64 FP registers (Closes #6180) - #6286

Merged
gHashTag merged 2 commits into
masterfrom
claude/t27b-f64
Oct 4, 2026
Merged

gHashTag merged 2 commits into
masterfrom
claude/t27b-f64

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 4, 2026

Copy link
Copy Markdown
Owner

What

t27b compiles f64 in AArch64 FP registers (Closes #6180):

  • f64 + - * /, unary minus, == != < <= > >=, float literals, f64 params, results, locals and consts.
  • @floatFromInt / @intFromFloat in Zig spelling, result type from context.
  • AAPCS64: f64 arguments and results in d0-d7.
  • Arithmetic in d16/d17: FADD/FSUB/FMUL/FDIV/FNEG/FCMP, SCVTF/UCVTF, FCVTZS/FCVTZU, FMOV. A value is its bit pattern in an X register or slot.
  • FCMP conditions (unordered gives NZCV=0011): Lt->MI, Le->LS, Gt->GT, Ge->GE, Eq->EQ, Ne->NE.
  • @intFromFloat traps at a named site when out of range or infinite. A NaN gives 0. Checked against zig 0.16.0 with zig test: Debug panics on inf and returns 0 on NaN for every int width.
  • Comptime floats follow Zig's f128 comptime_float. Only literals that are exactly a double are folded. An inexact literal may only be coerced to f64 or compared; anything else is rejected with "Zig folds it in f128".
  • @sqrt and std.math.* stay rejected and are named (ExprCall(@sqrt) in --blockers). No f32. No interpreter fallback.

Tests

  • FR-002: tests/encoder.rs adds 22 encodings (129 -> 151 cases), under an ARM ARM C7.2 citation, each with the encoding fields it checks.
  • FR-003: eval.rs computes f64 with the same IEEE ops as the JIT.
  • Five f64_ tests in tests/differential.rs compare interpreter and JIT bit-for-bit. A disagreement panics; nothing is skipped.
    • f64_arith_and_compare_match_interpreter, f64_conversions_match_interpreter and f64_mixed_arguments_and_calls_match_interpreter cover edge values: signed zeros, infinities, quiet/signalling NaNs with payloads, subnormals, 2^53, and every int bound.
    • f64_source_programs_run_in_both_engines runs source programs, including half(3.0) == 1.5.
    • f64_refusals_name_the_construct checks the refusals.
  • The source program's verdicts (pass / trap on 128.0->i8 / NaN->i8 == 0) were checked block by block with t27c gen + zig test.
  • Mutation check: flipping an FCMP condition in codegen makes the differential tests fail.
  • cargo test -p t27b: all green.

Outside the lane boundary (justified)

  • cli/t27b/src/jit.rs: the JIT entry has to load f64 arguments into d0-d7 and read d0 back (call_fp). The AAPCS64 requirement cannot be tested without this.
  • cli/t27b/tests/blockers.rs: its fixture used f64 as the example of an unsupported type. It now uses f32, which is still unsupported.

Corpus (t27b corpus specs)

before (bc472e7) after (e7f3b9f)
pass 166 (1024 tests) 181 (1124 tests)
pass_vacuous 278 279
fail 2 3
rejected 762 745
front-end error 40 40
mismatch 0 0
  • Newly passing files. 15 newly pass and 1 is newly pass_vacuous. All 16 also pass under t27c gen + zig test, with the same test counts. Files: base/debounce, benchmarks/gf16_bfloat16_nmse, conformance/e2e_scenarios, numeric/formats_catalog, physics/{e8_lqg_bridge, gamma-conflict, hslm_benchmark, lqg_cs_bridge}, port/fpga/verilog/e8m0_jtag, port/trinity/src/tri/{gen_aabb, gen_bezier, gen_quaternion, gen_rect}, the trios PH-01 and SC-00 libs, and trinet/etx.
  • New fail. port/trinity/src/tri/gen_vector2d.t27 Vec2_length fails because 5 Newton steps give 25.000000000167777, not 25.0. It fails under zig test as well, so the verdict matches.
  • After merging origin/master (feat(t27b): bench blocks as the reference path handles them (Closes #6179) #6258, bench blocks) into this branch. 1256 files: pass 191 (1217 tests), pass_vacuous 279, fail 3, rejected 743, front-end 40, mismatch 0.

Top 5 of --blockers (greedy, after the merge):

  step  +files  t27b-pass  need  construct
     1      32        502    54  ExprBinary(<< >>)
     2      28        530   104  StmtExpr
     3      24        554    77  StmtAssign(undeclared)
     4      19        573    39  ExprCall(assert with message)
     5      18        591    82  ExprIdentifier statement

Notes

🤖 Generated with Claude Code

gHashTag and others added 2 commits October 5, 2026 04:37
f64 + - * /, unary minus, comparisons, float literals, f64 params,
results, locals and consts; @floatFromInt / @intFromFloat in Zig
spelling with the result type from context. Arithmetic in d16/d17
(FADD/FSUB/FMUL/FDIV/FNEG/FCMP, SCVTF/UCVTF, FCVTZS/FCVTZU); AAPCS64
f64 arguments and results in d0-d7. Range-checked @intFromFloat traps
on out-of-range values and infinities; NaN gives 0 as in Zig 0.16 Debug.
Comptime floats fold only when exact (Zig folds comptime_float in f128).
@sqrt and std.math.* stay rejected and named. No f32, no interpreter
fallback.

Outside the lane boundary: jit.rs marshals d0-d7 (call_fp);
tests/blockers.rs used f64 as its example unsupported type, now f32.

Closes #6180

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	cli/t27b/tests/differential.rs
@gHashTag
gHashTag merged commit 591c5b4 into master Oct 4, 2026
24 of 25 checks passed
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-04 21:43:44 UTC

Summary

Status Count
Total Open PRs 44
PRs with Failing Checks 32
PRs with All Checks Green 12
READY 11
FAILING 32
PENDING 0
NO CHECKS YET 0

These columns do not partition: 11 + 32 + 0 + 0 = 43, and there are 44 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8597b6ded596 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t27b: f64 in AArch64 FP registers (first rejection in 28 specs)

1 participant