Created
March 18, 2013 02:23
-
-
Save kellegous/5184564 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint32_t FindMissing(uint32_t* arr) { | |
uint32_t res[4]; | |
__m128i c = _mm_set1_epi32(0); | |
for (int i = 0; i < 100; i+=4) { | |
c = _mm_add_epi32(c, | |
_mm_loadu_si128((__m128i*)&arr[i])); | |
} | |
_mm_store_si128((__m128i*)res, c); | |
return 5050 - res[0] - res[1] - res[2] - res[3]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment