Open verpeteren opened 10 months ago
Hi, You mention some valid concerns, along with some things that were intentional design decisions.
no_std
is an oversight, I will attempt to fix it soon.simd_unsafe_generate_all
to generate a list of unsafe functions for each instruction setI made the structs associated with the instruction sets private, as I can't make using them directly safe, but at the same time I want to keep the API as safe as possible (without needing unsafe blocks literally everywhere).
Does simd_unsafe_generate_all
fix the problem for you?
Oh also, the README example is outdated, please look at the examples folder for a functioning example. The sum
function there just does basic SIMD addition from one vector into another, although modern CPUs can optimize that at runtime via pipelining just fine, so I also added a function there called simd_get_sum
which does SIMD-based string parsing to parse all the numbers in the lists of characters and get the sum of them. Naturally, all of this needs more documentation, I just paused for a bit. I will look at it again soon though (today or next few days).
Ok I'm just looking at the no_std
compile error, would you be familiar with how to do neon
detection in no_std? It seems like it's possible to do x86 feature detection with no_std
, but ARM doesn't seem to support it.
related to the feature detection, rust doc
mentions:
Sorry, did you sent the above reply correctly? The code block seems empty
@arduano did an overhaul of the SIMD traits. That was a big undertaking and has many nice improvements like operator overloading. I am trying to port my stuff over to use the v2.0.0-dev3 (current master) branch and I noticed that there 3 problems:
it does not build with no_std (
cargo build --features "no_std"
)it does not build with no_std (
cargo build --features "sleef"
)it seems that only
scalar
is exposed. A simple test program withsse2
,sse41
oravx2
will fi lead tofailed to resolve: could not find 'avx2
'in 'simdeez'...
^^^^^ could not find 'avx2' in 'simdeez'`.Here is a simple test program (
src/main.rs
):Please advice on how to assist with these problems