Skip to content

Make AVX types castable#26353

Open
btolsch wants to merge 3 commits intoemscripten-core:mainfrom
btolsch:main
Open

Make AVX types castable#26353
btolsch wants to merge 3 commits intoemscripten-core:mainfrom
btolsch:main

Conversation

@btolsch
Copy link

@btolsch btolsch commented Feb 27, 2026

This change makes __m256* defined as vector types (i.e. __attribute__((__vector_size(32)))) so they can be cast to each other. The implementation of all the AVX functions are unchanged, but require conversion internally to the old struct types in order to call m128 functions on each lane.

Fixes #24076, fixes #26352.

__m128d v0;
__m128d v1;
} __m256d;
} __m256d_private;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would _internal make more sense the _private here?

Copy link
Author

Choose a reason for hiding this comment

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

Fine with me. Done.

@tlively
Copy link
Member

tlively commented Feb 27, 2026

This makes sense to me.

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.

AVX types (__m256{,i,d}) should be castable to each other AVX 256 functions accepting __m{128,256}i_u should accept __m{128,256}i

3 participants