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

Fixed Kenneth's PHP bug in max/min - was an aliasing bug in sse #56

Closed
wants to merge 5 commits into from
Closed

Fixed Kenneth's PHP bug in max/min - was an aliasing bug in sse #56

wants to merge 5 commits into from

Conversation

rrrlasse
Copy link
Contributor

No description provided.

@astigsen
Copy link
Contributor

Can you merge it with latest master so it can be pulled clean?

@astigsen
Copy link
Contributor

Could you add a small comment explaining why it had aliasing issues. I just got it explained by Kristian, but it is not easy to read from the source.

@@ -843,7 +843,7 @@ size_t Array::FirstSetBit64(int64_t v) const
if ((w == 8 || w == 16 || w == 32) && end - start > 2 * sizeof(__m128i) * 8 / NO0(w)) {
__m128i *data = (__m128i *)(m_data + start * w / 8);
__m128i state = data[0];
__m128i state2;
char state2[sizeof(state)];
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure that changing the type of state2 has no effect on the aliasing issue. I believe what fixes the aliasing bug is the fact that memcpy() modifies state2 as though it was a character array. I would love to see what happens when reverting state2 back to __m128i. Hopefully nothing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please ignore my comments on aliasing. My theory turned out to be wrong.

@kspangsege
Copy link
Contributor

+1

…ryspeed

Conflicts:
	TightDB.vcxproj
	src/tightdb/alloc_slab.cpp
	src/tightdb/alloc_slab.hpp
	test/transactions.cpp
@rrrlasse
Copy link
Contributor Author

I've fixed this by modifying our masterbranch directly and bypassed this pull requst.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants