Skip to content

Fix SIMD fallback code when AVX2 is not available#228

Open
j-schultz wants to merge 2 commits into
xiph:mainfrom
alfatraining:fix-simd
Open

Fix SIMD fallback code when AVX2 is not available#228
j-schultz wants to merge 2 commits into
xiph:mainfrom
alfatraining:fix-simd

Conversation

@j-schultz

Copy link
Copy Markdown
Contributor

Currently the code first typedefs a fallback type based on __m256i and only on the following line it actually defines __m256i as the emulated type. This needs to be the other way around!

This PR also adds a basic .gitignore for the recently-added downloaded model files.

Comment thread src/vec_avx.h
} mm256i_emu;
typedef __m256i real_m256i;
#define __m256i mm256i_emu
typedef __m256i real_m256i;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Doesn't this simply become typedef mm256i_emu real_m256i after preprocessing?

@j-schultz j-schultz Jun 24, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but mm256i_emu is also used in other places. I just wanted to fix the code with the least changes possible to make it easy to review.

@johncf johncf Jun 24, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

But if both are always the same type, there wouldn't be any need to define this union (which is only relevant when __AVX2__ is not defined but __AVX__ is).

Note: I'm not familiar with the codebase, just started exploring for a project. Just pointing out a logical inconsistency.

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.

2 participants