Skip to content

Rewrote to_register utility - #41

Merged
rarutyun merged 2 commits into
mainfrom
to_register
Oct 15, 2026
Merged

rarutyun merged 2 commits into
mainfrom
to_register

Conversation

@danieltowner

Copy link
Copy Markdown
Contributor

Previously to_register would return a builtin with enough elements to fill a complete register of the appropriate size, but this often wouldn't be allowed as a parameter to an intrinsic. The new version converts the register type to the one of the common intrinsic types (e.g., __m256i, __m512d, __m128h). This simplifies intrinsic calls by allowing to_register to handle the type conversion without also requiring an explicit cast at the intrinsic call site.

This work is an important step in eliminating the use of flax-vector-conversions since it allows intrinsic calls without implicit conversions.

Previously `to_register` would return a builtin with enough elements to fill a complete register of the appropriate
size, but this often wouldn't be allowed as a parameter to an intrinsic. The new version converts the register type
to the one of the common intrinsic types (e.g., __m256i, __m512d, __m128h). This simplifies intrinsic calls by
allowing `to_register` to handle the type conversion without also requiring an explicit cast at the intrinsic call site.

This work is an important step in eliminating the use of `flax-vector-conversions` since it allows intrinsic calls
without implicit conversions.
Comment thread include/xvec/detail/core.hpp Outdated
Comment thread include/xvec/x86/permute.hpp
Comment thread include/xvec/x86/x86_impl.hpp
Comment thread include/xvec/detail/target_config.hpp
@rarutyun rarutyun mentioned this pull request Oct 14, 2026
@danieltowner
danieltowner requested a review from rarutyun October 15, 2026 15:00
@rarutyun
rarutyun merged commit f0c1630 into main Oct 15, 2026
4 checks passed
@rarutyun
rarutyun deleted the to_register branch October 15, 2026 19:12
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