Skip to content

Replace asm!() with __jcvt() on AArch64 for f64 → i32 conversion - #5577

Merged
jedel1043 merged 1 commit into
boa-dev:mainfrom
linkmauve:__jcvt
Oct 11, 2026
Merged

jedel1043 merged 1 commit into
boa-dev:mainfrom
linkmauve:__jcvt

Conversation

@linkmauve

Copy link
Copy Markdown
Contributor

I originally added this intrinsic for Ruffle[1][2], it is now available since Rust 1.95.0[3], and should be easier to read and use.

I’m not sure if the check for NaN is still useful or not, Ruffle doesn’t need it, but maybe they configure the FPU differently.

[1] ruffle-rs/ruffle#22138
[2] ruffle-rs/ruffle#23937
[3] rust-lang/stdarch#1993

This Pull Request doesn’t fix any issue.

It changes the following:

  • It now uses the __jcvt() intrinsic instead of a raw asm!() block.

@linkmauve
linkmauve requested a review from a team as a code owner October 11, 2026 14:47
@github-actions github-actions Bot added the Waiting On Review Waiting on reviews from the maintainers label Oct 11, 2026
@github-actions github-actions Bot added this to the v0.23 milestone Oct 11, 2026
@github-actions github-actions Bot added the C-Builtins PRs and Issues related to builtins/intrinsics label Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Test262 conformance changes

Test result main count PR count difference
Total 53,578 53,578 0
Passed 51,447 51,447 0
Ignored 1,648 1,648 0
Failed 483 483 0
Panics 0 0 0
Conformance 96.02% 96.02% 0.00%

Tested main commit: 53d8a0722967cc96319141d88ad2730bc8b0ec73
Tested PR commit: 7d81683763bc7794f3a1202fe5f4d31074d05f55
Compare commits: 53d8a07...7d81683

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.14%. Comparing base (6ddc2b4) to head (7d81683).
⚠️ Report is 1069 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5577       +/-   ##
===========================================
+ Coverage   47.24%   63.14%   +15.90%     
===========================================
  Files         476      536       +60     
  Lines       46892    60315    +13423     
===========================================
+ Hits        22154    38086    +15932     
+ Misses      24738    22229     -2509     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

I originally added this intrinsic for Ruffle[1][2], it is now available
since Rust 1.95.0[3], and should be easier to read and use.

I’m not sure if the check for NaN is still useful or not, Ruffle doesn’t
need it, but maybe they configure the FPU differently.

[1] ruffle-rs/ruffle#22138
[2] ruffle-rs/ruffle#23937
[3] rust-lang/stdarch#1993

@jedel1043 jedel1043 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice cleanup. Thank you!

@jedel1043
jedel1043 added this pull request to the merge queue Oct 11, 2026
Merged via the queue into boa-dev:main with commit 64be2e1 Oct 11, 2026
22 checks passed
@github-actions github-actions Bot removed the Waiting On Review Waiting on reviews from the maintainers label Oct 11, 2026
@linkmauve
linkmauve deleted the __jcvt branch October 12, 2026 07:06
@jedel1043 jedel1043 mentioned this pull request Oct 16, 2026
zhuzhu81998 pushed a commit to zhuzhu81998/boa that referenced this pull request Oct 16, 2026
Closes boa-dev#5571.

`/^(?:\D\b)$/iv.test("\u212a")` currently returns false. The conversion
to `regress::Flags` enables Unicode-aware matching only for `u`, leaving
`v` word boundaries in non-Unicode mode. Enable the backend's `unicode`
flag for either JavaScript Unicode flag, while preserving the separate
`unicode_sets` flag and the public `.unicode` / `.unicodeSets` getters.

The regression covers Kelvin sign and long s with `iv`, `iu`, plain `v`,
and plain `i`, plus `\w`, `\W`, and the exposed flag getters. This
follows [HasEitherUnicodeFlag and
WordCharacters](https://tc39.es/ecma262/multipage/text-processing.html#sec-wordcharacters).

Validation:

- The new regression fails on the original implementation at the issue's
Kelvin-sign example.
- `cargo test -p boa_engine -p boa_parser --lib -j 2`: 1,452 passed, 1
ignored.
- All ten regression assertions also pass in Node.js.
- `cargo fmt --all --check` and `git diff --check` pass.
- Clippy passes for the affected packages with all targets, and for the
entire workspace with all features/all targets and with no default
features. Each run uses `-D warnings -A clippy::incompatible_msrv`:
strict Clippy on this ARM Mac reports an existing MSRV diagnostic at
`core/engine/src/builtins/number/conversions.rs:85` (`__jcvt`,
introduced by boa-dev#5577, outside this change). Toolchain: Rust 1.98.0.

AI disclosure: Codex implemented and tested this change autonomously
with the account owner's authorization. No human review is claimed.
Basharkhan7776 pushed a commit to Basharkhan7776/rust-js-parser that referenced this pull request Oct 18, 2026
We forgot to bump the version on boa-dev#5577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Builtins PRs and Issues related to builtins/intrinsics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants