-
Notifications
You must be signed in to change notification settings - Fork 169
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
Conversation
Can you merge it with latest master so it can be pulled clean? |
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)]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
+1 |
…ryspeed Conflicts: TightDB.vcxproj src/tightdb/alloc_slab.cpp src/tightdb/alloc_slab.hpp test/transactions.cpp
I've fixed this by modifying our masterbranch directly and bypassed this pull requst. |
No description provided.