-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SIMD internally #145
Comments
Just so we're clear, are you talking about the scalar functions provided by sleef (e.g., |
The scalar functions, with an error of 1 ULPs (those with the |
sleef-rs |
@burrbull the sleef-sys crate (wrapper over the C library - what we are trying to avoid here) is used by packed_simd and is tested - sleef only supports x86_64 linux, x86_64 apple, and x86_64 windows. Currently, 32-bit linux is advertised but not workin, so that heavily limits the targets where it can be used. You can probably add sleef-sys as a dev dependency to test sleef-rs against sleef in those architectures at least though. |
The
sleef
library is available with the Boost software license (extremely permissive) and implements the libm intrinsics using SIMD instructions when possible. It currently supports:libm
should usecfg(target_feature)
(stable) internally to detect the availability of SIMD instructions at compile-time and use them when it is possible and pays off.We could add an
unstable
cargo feature tolibm
to enable using nightly only features to detect and useasimd
,neon
,vsx
, andAVX-512
(there are still unstable incore::arch
). Someasimd
,neon
,vsx
andAVX-512
intrinsics are already available incore::arch
in nightly, and it shouldn't be too difficult to add anyone that's missing.As long as we include the proper contribution notice, and maybe dual license the library under the Boost license (this should be easily possible), we could reuse 1:1 the sleef implementation which competes performance wise with libm and intel's libraries. There is a commit under review to add Sleef to LLVM, but it has been stalled for over a year.
The text was updated successfully, but these errors were encountered: