Skip to content

Conversation

@Rogiel
Copy link

@Rogiel Rogiel commented Dec 26, 2023

This fixes an incorrect implementation for FMA on NEON.

I also had issues compiling the library due to the the enable_if constraint on NEON f32 register constructor. Looking at the other implementations, they don't have the enable_if, but I wasn't entirely sure what it's purpose was.

Here's a before an after for comparison:
image
image

@Auburn
Copy link
Owner

Auburn commented Dec 29, 2023

Thanks, did you run the tests on MacOS ARM? I don't have a Mac device to test it myself

@Rogiel
Copy link
Author

Rogiel commented Dec 29, 2023

Yes, I ran FastNoise2 (NewFastSIMD branch) on a MacBook with the M1 CPU.

@Auburn
Copy link
Owner

Auburn commented Jan 3, 2024

The enable_if on the mask register is to avoid ambiguous implicit conversions. The AVX512 m32 also uses it, without it there are compiler errors. What error are you getting with the enable_if?

@api-haus
Copy link
Contributor

Hey guys. I've confirmed this indeed fixes Auburn/FastNoise2#161

I've confirmed this works with latest NewFastSIMD branch on Apple Silicon.

Could this be merged? Thanks to all involved.


template<typename T = NativeType>
FS_FORCEINLINE Register( std::enable_if_t<OPTIMISE_FLOAT, T> v ) : native( v ) { }
FS_FORCEINLINE Register( NativeType v ) : native( v ) { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is possibly outdated. I was able to confirm the fix without this change.

@Auburn
Copy link
Owner

Auburn commented Aug 31, 2025

Could you remake the change in a new PR without the change to enable_if. I don't have any apple silcone to test on, thanks

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.

3 participants