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

Add memory semantics checks to validate atomics #1234

Closed
wants to merge 1 commit into from

Conversation

atgoo
Copy link

@atgoo atgoo commented Jan 25, 2018

Fixes #252

Memory semantics checks are performed if the bit field was declared as int constant.

Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Seems we could also ensure that the mask & 1 is zero. (That is, avoid the placeholder for Consume).
I'll file a separate enhancement issue for that.

@@ -23,6 +23,89 @@

namespace libspirv {

// Returns number of '1' bits in a word.
uint32_t CountSetBits(uint32_t word) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI this is also known as "population count" or popcount which is sometimes a builtin in some compilers.

But this is fine. :-)

@dneto0
Copy link
Collaborator

dneto0 commented Jan 30, 2018

Rebased and pushed onto master as 44d88c8

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.

None yet

2 participants