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

Fix MaskBool initialization on SSE #300

Merged
merged 1 commit into from
Sep 3, 2021
Merged

Conversation

amyspark
Copy link
Contributor

@amyspark amyspark commented Sep 2, 2021

Fixes #255 by initializing the mask in the same way as AVX.

Includes a test that will assess the condition if Vc is compiled with -DCMAKE_CXX_FLAGS=-ffinite-math-only. (In all other cases it'll always return true, as explained by the reporter.)

return MaskBool(m.d.m(i));
return m.toInt() & (1 << i);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess that works. Looking at the previous implementation, it aliased the vector register by a T array and then accessed at i. That is what's happening in m.d.m(i). So that might fore storing the register to memory. Your solution probably stays within the registers and might even be more efficient. AVX also uses your implementation.

@amadio amadio merged commit b84dcd0 into VcDevel:1.4 Sep 3, 2021
@amyspark amyspark deleted the amyspark/255 branch September 3, 2021 12:48
@bernhardmgruber bernhardmgruber added this to the Vc 1.4.3 milestone May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

operator[] of Masks returning undefined values
3 participants