Skip to content

perf(backend): lower scalar floating-point operations to native instructions - #1704

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/native-floating-point/lower-scalar-floating-point-operations-native--2c4c14a1
Oct 22, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/native-floating-point/lower-scalar-floating-point-operations-native--2c4c14a1

Conversation

@tignear

@tignear tignear commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Basic scalar floating-point operations previously became native helper calls. Preserve the existing precision-aware SIR operations in dedicated FloatBinary/FloatUnary MIR instructions and emit SSE2 on x86-64 and floating-point instructions on AArch64. Cranelift now also lowers typed FP operations directly; Wasm already did.

Cover f32/f64 arithmetic, comparisons, negation, truth conversion, and precision conversion. Track MIR operands, scheduling, memory effects, and x86 scratch-register clobbers so live scalar and SIMD values remain intact. Keep helpers for remainder, power, and integer conversions requiring existing rounding/modulo behavior. The native image ABI is unchanged.

Validation:

  • 614 x86 backend tests, 49 AArch64 backend tests, and 34 Cranelift/Wasm tests passed.
  • 177 focused integration tests passed across FP execution/display, SystemVerilog FP, native MIR, fresh-process native images, and shared JIT caches; existing Veryl exclusions retained.
  • Regression tests verify helper-free basic FP lowering, NaNs, signed zero, infinities, subnormals, register pressure, and SIMD scratch clobbers.
  • Affected crates pass clippy; formatting and diff checks pass.
  • AArch64 instruction selection and exact emitted encodings were tested locally; AArch64 execution was unavailable on this x86 host.

Refs #1654

…uctions

Basic scalar floating-point operations previously became native helper calls. Preserve the existing precision-aware SIR operations in dedicated FloatBinary/FloatUnary MIR instructions and emit SSE2 on x86-64 and floating-point instructions on AArch64. Cranelift now also lowers typed FP operations directly; Wasm already did.

Cover f32/f64 arithmetic, comparisons, negation, truth conversion, and precision conversion. Track MIR operands, scheduling, memory effects, and x86 scratch-register clobbers so live scalar and SIMD values remain intact. Keep helpers for remainder, power, and integer conversions requiring existing rounding/modulo behavior. The native image ABI is unchanged.

Validation:
- 614 x86 backend tests, 49 AArch64 backend tests, and 34 Cranelift/Wasm tests passed.
- 177 focused integration tests passed across FP execution/display, SystemVerilog FP, native MIR, fresh-process native images, and shared JIT caches; existing Veryl exclusions retained.
- Regression tests verify helper-free basic FP lowering, NaNs, signed zero, infinities, subnormals, register pressure, and SIMD scratch clobbers.
- Affected crates pass clippy; formatting and diff checks pass.
- AArch64 instruction selection and exact emitted encodings were tested locally; AArch64 execution was unavailable on this x86 host.

Refs #1654

Change-Id: I2c4c14a1a72869a91174315d6b08aa90576f05f7
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T00:15:59.795801Z
We couldn’t complete this review. Comment @codex review to try again.
bdd6ab7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 22, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 22, 2026
@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 1 hour 29 minutes 42 seconds in the queue, including 1 hour 27 minutes 8 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@tignear tignear linked an issue Oct 22, 2026 that may be closed by this pull request
@mergify
mergify Bot merged commit e06cf24 into master Oct 22, 2026
30 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/native-floating-point/lower-scalar-floating-point-operations-native--2c4c14a1 branch October 22, 2026 03:02
@mergify mergify Bot removed the queued Mergify queue entry label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: emit native floating-point instructions for common operations

1 participant