FastNoise2
FastNoise2 copied to clipboard
Fix NEON bugs
I couldn't compile NEON sources on M1 Mac, so I fixed some bugs, typos and implemented missing operators.
Thanks for looking at this, it's been on my to-do list for ages. Tbh I thought it would be more work than that!
I had a quick test on my raspberry pi and had a few type mismatch compile errors, probably a GCC Vs Clang difference. I will look into it further soon.
The only thing that looks odd to me is the negative sign bit shifting, the right shift needs to sign extend.
vshlq_n_s32, vshrq_n_s32 take a compile time constant value as its parameter, so I used vshlq_s32. https://developer.arm.com/documentation/dui0491/i/Using-NEON-Support/Shifts-by-a-constant
And vsh”r”q_s32 doesn’t exist because left-shift of a negative value means right-shift. https://developer.arm.com/documentation/dui0491/i/Using-NEON-Support/Shifts-by-signed-variable
I pulled the changes into a branch, fixed up a few more errors and setup cmake to detect ARM correctly. There are still a bunch more compile errors though which I don't have time to look into now.
https://github.com/Auburn/FastNoise2/tree/fix-neon-bugs
Hello @Auburn and @atarabi, it would be really nice to have Apple M1 supported by FastNoise2 out of the box. I've successfully built atarabi project version on my MacBook Air with M1, but found that Simplex and Perlin noise generators are working incorrectly with NEON vectorization, while working fine in Scalar. Would it be possible to fix this bug and merge M1 support into the master?
NEON:
Scalar:
Hi! Is this merged somehow into master? In master there are many other commits about NEON and ARM, so I was wondering if it's better to use master or this branch for Mac with M processor