Skip to content
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

Fix NEON bugs #88

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix NEON bugs #88

wants to merge 4 commits into from

Conversation

atarabi
Copy link

@atarabi atarabi commented Jun 12, 2022

I couldn't compile NEON sources on M1 Mac, so I fixed some bugs, typos and implemented missing operators.

@Auburn
Copy link
Owner

Auburn commented Jun 13, 2022

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.

@atarabi
Copy link
Author

atarabi commented Jun 13, 2022

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

@Auburn
Copy link
Owner

Auburn commented Jun 13, 2022

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

@egorodet
Copy link

egorodet commented Jan 27, 2023

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:
Screenshot 2023-01-27 at 21 30 57

Scalar:
Screenshot 2023-01-27 at 21 31 08

@andraghetti
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants