Implement fjcvtzs under the name __jcvt like the C intrinsic#1938
Merged
folkertdev merged 1 commit intorust-lang:masterfrom Oct 10, 2025
Merged
Implement fjcvtzs under the name __jcvt like the C intrinsic#1938folkertdev merged 1 commit intorust-lang:masterfrom
folkertdev merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @folkertdev rustbot has assigned @folkertdev. Use |
folkertdev
reviewed
Oct 9, 2025
3 tasks
f232b69 to
647e435
Compare
Contributor
|
you also need to enable your new feature here for the automated testing to work |
This instruction is only available when the jsconv target_feature is available, so on ARMv8.3 or higher. It is used e.g. by Ruffle[0] to speed up its conversion from f64 to i32, or by any JS engine probably. I’ve picked the stdarch_aarch64_jscvt feature because it’s the name of the FEAT_JSCVT, but hesitated with naming it stdarch_aarch64_jsconv (the name of the target_feature) or stdarch_aarch64_jcvt (the name of the C intrinsic) or stdarch_aarch64_fjcvtzs (the name of the instruction), this choice is purely arbitrary and I guess it could be argued one way or another. I wouldn’t expect it to stay unstable for too long, so ultimately this shouldn’t matter much. This feature is now tracked in this issue[1]. [0] ruffle-rs/ruffle#21780 [1] rust-lang/rust#147555
Contributor
Author
Oops, thanks for the hint. |
linkmauve
added a commit
to linkmauve/ruffle
that referenced
this pull request
Nov 4, 2025
In ruffle-rs#21780, an optimisation has been added to use the fjcvtzs ARMv8.3 instruction when available, to convert a f64 into an i32. This made me wonder why core::arch::aarch64 didn’t have an intrinsic for this instruction, so I implemented it in stdarch[1], which got pulled in Rust yesterday[2] (see the tracking issue[3]). This PR makes use of this new intrinsic to remove the unsafe asm!() block, and simplify the code. [1] rust-lang/stdarch#1938 [2] rust-lang/rust#148402 [3] rust-lang/rust#147555
linkmauve
added a commit
to linkmauve/ruffle
that referenced
this pull request
Nov 4, 2025
In ruffle-rs#21780, an optimisation has been added to use the fjcvtzs ARMv8.3 instruction when available, to convert a f64 into an i32. This made me wonder why core::arch::aarch64 didn’t have an intrinsic for this instruction, so I implemented it in stdarch[1], which got pulled in Rust yesterday[2] (see the tracking issue[3]). This PR makes use of this new intrinsic to remove the unsafe asm!() block, and simplify the code. [1] rust-lang/stdarch#1938 [2] rust-lang/rust#148402 [3] rust-lang/rust#147555
linkmauve
added a commit
to linkmauve/ruffle
that referenced
this pull request
Jan 13, 2026
In ruffle-rs#21780, an optimisation has been added to use the fjcvtzs ARMv8.3 instruction when available, to convert a f64 into an i32. This made me wonder why core::arch::aarch64 didn’t have an intrinsic for this instruction, so I implemented it in stdarch[1], which got pulled in Rust yesterday[2] (see the tracking issue[3]). This PR makes use of this new intrinsic to remove the unsafe asm!() block, and simplify the code. [1] rust-lang/stdarch#1938 [2] rust-lang/rust#148402 [3] rust-lang/rust#147555
linkmauve
added a commit
to linkmauve/ruffle
that referenced
this pull request
Jan 13, 2026
In ruffle-rs#21780, an optimisation has been added to use the fjcvtzs ARMv8.3 instruction when available, to convert a f64 into an i32. This made me wonder why core::arch::aarch64 didn’t have an intrinsic for this instruction, so I implemented it in stdarch[1], which got pulled in Rust yesterday[2] (see the tracking issue[3]). This PR makes use of this new intrinsic to remove the unsafe asm!() block, and simplify the code. [1] rust-lang/stdarch#1938 [2] rust-lang/rust#148402 [3] rust-lang/rust#147555
Merged
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.
This instruction is only available when the
jsconvtarget_feature is available, so on ARMv8.3 or higher.It is used e.g. by Ruffle to speed up its conversion from
f64toi32, or by any JS engine probably.I got redirected to this repository from rust-lang/rust#147517