Repository navigation
feat(t27b): lower type f32 in s registers (Closes #6448) - #6456
Merged
Merged
Conversation
Single precision reuses the f64 FP-register path: s registers, fcvt between precisions, int<->f32 conversions, comparisons, and literals rounded like Zig's comptime_float -> f32 (inexact literals whose f64 is an f32 rounding boundary are refused). Corpus with the reference: counted 379 -> 382 of 723, mismatch 0. Closes #6448 Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
6 tasks
…: float, tuple) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-05 15:34:25 UTC
Summary
Seal Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6448
Refs #6063
What
Ty::F32in the t27b IR, interpreter and AArch64 backend. Values live in s registers, canonical like a u32. The encodings are the double ones with bit 22 clear, plusfmov s/wandfcvtbetween precisions. It shares the f64 path from feat(t27b): f64 in AArch64 FP registers (Closes #6180) #6286 throughfp_in/fp_out/fp_opincodegen.rs.1.0000000596046447753906250001gives 0x3f800001 in Zig and1.00000005960464477539062499gives 0x3f800000, yet both are the same f64.16777217is a Zig compile error.@floatCastwith a result type rounds to nearest even and gives inf on overflow, matching Zig's runtime cast.@floatFromIntand an intas f32round once, straight from the integer.@intFromFloatfrom an f32 goes through the f64 bounds check.cli/t27b/src/lower_float.rs. The hooks inlower.rsare small, to stay clear of the parallel lanes.as,@floatCastof a literal or with no result type, andx * 2^kon f32 (the t27c shift bug t27c gen: strength_reduce turns f64 x * 2 into x << 1 (does not compile) #6284).Tests
-arch arm64+ objdump. Disassembler read-back covers the new forms.+ - * /, negation, the six compares as values and as branches, and f64 round-trips.@floatFromInt/@intFromFloatfor every int type, including the traps.@floatCastin both directions, including exact f32 midpoints.t27c test-report(Zig 0.16): one pass, and one@intFromFloattrap.cargo test -p t27b: all green.Corpus (
t27b corpus specs --blockers --reference <t27c> --reference-cache, jobs 6, load avg ~200-300)specs/tri/catalog/health.t27)Newly passing f32 files:
specs/benchmarks/bench_nn.t27,specs/brain/unified_state.t27,specs/port/trios/crates/trios-trinity-brain/src/phi.t27.type f32is no longer a blocker anywhere; its 1224 occurrences are gone. In the other 4 lab files that started on f32, the next blockers are StmtAssign(undeclared) x2,@expand@sqrt.🤖 Generated with Claude Code