3 ms·
I'm not a rust programmer. Can't you just make a local copy of the existing package and use that? Did you need to re-implement?
by ____tom____ 11mo ago
I'm not a rust programmer.
Can't you just make a local copy of the existing package and use that? Did you need to re-implement?
- the__alchemist 11mo agoGood question. Probably, but I don't know how and haven't tried.
- deleted 11mo ago[deleted]
- dzaima 11mo agoThe nightly built-in core::simd makes use of a bunch of intrinsics to "implement" the SIMD ops (or, rather, directly delegate the implementation to LLVM which you otherwise cannot do from plain Rust), which are as much if not more volatile than core::simd itself (and also nightly-only).
- vlovich123 11mo ago> or, rather, directly delegate the implementation to LLVM which you otherwise cannot do from plain Rust I thought the intrinsic specifically were available in plain safe rust and the alignment required intrinsics were allowed in unsafe rust. I’m not sure I understand this “direct to llvm dispatch” argument or how that isn’t accessible to stable Rust today.
- dzaima 11mo agoYou can indeed use intrinsics to make a SIMD library in plain safe stable rust today to some extent; that just isn't what core::simd does; rather, on the Rust-side it's all target-agnostic and LLVM (or whatever other backend) handles deciding how to lower any given op to the target architecture. e.g. all core::simd addition ends up invoking the single function [1] which is then directly handled by rustc. But these architecture-agnostic intrinsics are unstable[2] (as they're only there as a building block for core::simd), and you can't manually use "#[rustc_intrinsic]" & co in stable rust either. [1]: https://github.com/rust-lang/rust/blob/b01cc1cf01ed12adb2595c4696321ee722ef545e/library/core/src/intrinsics/simd.rs#L65-L67 https://github.com/rust-lang/rust/blob/b01cc1cf01ed12adb2595... [2]: https://github.com/rust-lang/rust/blob/b01cc1cf01ed12adb2595c4696321ee722ef545e/library/core/src/intrinsics/mod.rs#L48-L54 https://github.com/rust-lang/rust/blob/b01cc1cf01ed12adb2595...
- the__alchemist 11mo agoThis is what I ended up doing as a stopgap.