arduano / simdeez

easy simd
MIT License
331 stars 25 forks source link

NEON support #4

Closed jackmott closed 5 years ago

jackmott commented 6 years ago

Neon simd instructions for arm cpus are in nightly now I believe, someone could make a new branch and start implementing the simd trait for neon

I'm happy to help anyone get started, just ask for help and I'll walk you through it. You don't need a lot of specialist knowledge, it is a nice way to learn about simd.

It will be helpful to have an arm/neon capable cpu so you can test, though it isn't necessary.

TerminalWitchcraft commented 6 years ago

I have a raspberry pi 3 model b(I guess it supports neon, armv8). Once I'm done with epi8, mabe I'll have a look into this implementation.

jackmott commented 6 years ago

I Think neon started with armv7 so yeah it should have it. This looks like a good reference for neon intrinsics maybe: https://developer.arm.com/technologies/neon/intrinsics

Neon will probably be a bit of a challenge since it will likely not map onto avx2 so perfectly, so we shall see what we can do!

jackmott commented 6 years ago

I've pushed up a new branch "neon" where Ive started experimenting with how to organize things. Neon and x86 stuff will need to be totally separated by build time configuration. You can't build x64 intrinsics if the target is arm and vice versa. it looks like the cfg_if crate will be handy for that (see mod.rs). It lets you crate blocks of code that are conditionally compiled, rather than having the put the cfg attribute before every single function and use statement, but I'm open to suggestions, still just experimenting.

keep in mind neon is only on nightly for now.

TerminalWitchcraft commented 6 years ago

Thanks for the input. I'll look into it this weekend.

jackmott commented 6 years ago

I think it might make more sense to put the arm/neon stuff all in different files, and then conditionally pull it in from mod.rs or something, then we wouldn't need the dependency of cfg-if, and things would be less messy. I'll do more experimenting.

jackmott commented 5 years ago

closing this for now since Rust still doesn't have neon intrinsics yet

wrenger commented 1 year ago

Neon is stable for aarch64 since 1.59 (even if rustdoc is wrong about it https://github.com/rust-lang/stdarch/issues/1268). Do you still have plans (and maybe time) to add support for this?