jackmott / nim_simd

Nim experiment for a write once run optimum simd anywhere *at runtime* library
MIT License
30 stars 1 forks source link

Friendly wrappers around loadu/storeu #2

Open RedBeard0531 opened 6 years ago

RedBeard0531 commented 6 years ago

loudu/storeu_si128/256 should have overloads that takes a pointer since they are intended to load 16/32 bytes of data from an arbitrary address. It would be nice if they could also take seq/string inputs + offset (or macro it and take string[index]) and do the addring for me. It would be super nice if it did whatever magic is necessary to make loadu not require a var string and work with a normal immutable argument.

As an example of how gross this looks in the middle of code: https://github.com/RedBeard0531/advent_of_code_2017/blob/c88c4b0bf6d48d4a5d489f674658efc13e983af3/16/a16_2_sse_brute.nim#L85-L89

jackmott commented 6 years ago

I agree this is a good idea, I welcome PRs with or comments with ideas on how it should work. I will have some time to experiment with it eventually.