You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Intercept calls to (rust) libm and emit a builtin instead of the soft impl #81
Plan is to go with @bjorn3's comment below and expose the GLOps not in std::intrinsics via intercepting calls to https://github.com/rust-lang/libm, which is used in e.g. glam's no_std implementation.
Ran into this today with tan that glam is using (#134), it is not part of the Rust core intrinsics functions. Any idea of how to add our own intrinsics, do we have to do that in core or as another set of intrinsics for the specific target?
changed the title [-]Expose GLOps not in std::intrinsics[/-][+]Intercept calls to (rust) libm and emit a builtin instead of the soft impl[/+]on Nov 10, 2020
Activity
repi commentedon Oct 25, 2020
Ran into this today with
tanthat glam is using (#134), it is not part of the Rust core intrinsics functions. Any idea of how to add our own intrinsics, do we have to do that in core or as another set of intrinsics for the specific target?bjorn3 commentedon Oct 25, 2020
libstd directly calls the libm functions. Adding an extra intrinsic requires a rustc change to add it to the list of intrinsics of typeck.
repi commentedon Oct 25, 2020
Suspected that, definitely don't want to use
libmon the GPU for where there is real GPU/SPIRV intrinsics to usebjorn3 commentedon Oct 25, 2020
It should be possible to intercept calls to functions with specific names and instead emit a SPIRV instruction.
[-]Expose GLOps not in std::intrinsics[/-][+]Intercept calls to (rust) libm and emit a builtin instead of the soft impl[/+]khyperia commentedon Nov 25, 2020
Fixed by #264