libdivide.h: Silence "warning: variable 'result' is uninitialized when used here [-Wuninitialized]".

git-svn-id: https://svn.eduke32.com/eduke32@5731 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-05-23 04:46:02 +00:00
parent 4282640c6c
commit 1f761df37f

View file

@ -260,6 +260,7 @@ static inline __m128i libdivide_get_00000000FFFFFFFF(void) {
return result; return result;
} }
#if 0
static inline __m128i libdivide_get_0000FFFF(void) { static inline __m128i libdivide_get_0000FFFF(void) {
//returns the same as _mm_set1_epi32(0x0000FFFFULL) without touching memory //returns the same as _mm_set1_epi32(0x0000FFFFULL) without touching memory
__m128i result; //we don't care what its contents are __m128i result; //we don't care what its contents are
@ -267,6 +268,7 @@ static inline __m128i libdivide_get_0000FFFF(void) {
result = _mm_srli_epi32(result, 16); result = _mm_srli_epi32(result, 16);
return result; return result;
} }
#endif
static inline __m128i libdivide_s64_signbits(__m128i v) { static inline __m128i libdivide_s64_signbits(__m128i v) {
//we want to compute v >> 63, that is, _mm_srai_epi64(v, 63). But there is no 64 bit shift right arithmetic instruction in SSE2. So we have to fake it by first duplicating the high 32 bit values, and then using a 32 bit shift. Another option would be to use _mm_srli_epi64(v, 63) and then subtract that from 0, but that approach appears to be substantially slower for unknown reasons //we want to compute v >> 63, that is, _mm_srai_epi64(v, 63). But there is no 64 bit shift right arithmetic instruction in SSE2. So we have to fake it by first duplicating the high 32 bit values, and then using a 32 bit shift. Another option would be to use _mm_srli_epi64(v, 63) and then subtract that from 0, but that approach appears to be substantially slower for unknown reasons