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

Provide a generic version for float to uint32_t conversion #963

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

serge-sans-paille
Copy link
Contributor

This remove duplicate code for various Intel implementation and should also help for #962.

batch<float, A> cnst65536f(65536.0f);

auto v_lo = batch_cast<int32_t>(v & msk_lo); /* extract the 16 lowest significant bits of self */
auto v_hi = batch_cast<int32_t>(v >> 16); /* 16 most significant bits of v */
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused here; fast_cast is supposed to be called by the generic batch_cast when a fast cast is available. Replacing the implementation specific to instruction sets with this generic one would end in calling the "slow" batch cast, right? Or am I missing sometihng?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I was thinking along the same lines. Can we replace specific implementations with a generic one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I've adjusted the generic conversion to only be selected if we have a fast conversion from int32 to float.

…he int32 conversion is available

This remove duplicate code for various Intel implementation and should
also help for #962.
@JohanMabille JohanMabille merged commit 011d355 into master Oct 31, 2023
98 checks passed
@JohanMabille JohanMabille deleted the feature/syndicate-fast-cast-code branch October 31, 2023 12:42
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