diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-02-19 20:06:49 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-07-17 19:19:24 +0300 |
commit | 181510bd6eb767361da5e02e41be08cc65b36b08 (patch) | |
tree | bbd53801c1f1a9d8ad65405c5fe5de445a5aacba /test cases | |
parent | 8396c4f3e6bfea6bbef6539055090902c089d375 (diff) | |
download | meson-181510bd6eb767361da5e02e41be08cc65b36b08.zip meson-181510bd6eb767361da5e02e41be08cc65b36b08.tar.gz meson-181510bd6eb767361da5e02e41be08cc65b36b08.tar.bz2 |
Fix checks on MinGW and VS2010.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/common/139 simd/simd_mmx.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test cases/common/139 simd/simd_mmx.c b/test cases/common/139 simd/simd_mmx.c index dd78dd6..6a959db 100644 --- a/test cases/common/139 simd/simd_mmx.c +++ b/test cases/common/139 simd/simd_mmx.c @@ -8,7 +8,6 @@ int mmx_available() { return 1; } - /* Contrary to MSDN documentation, MMX intrinsics * just plain don't work. */ @@ -18,7 +17,18 @@ void increment_mmx(float arr[4]) { arr[2]++; arr[3]++; } - +#elif defined(__MINGW32__) +int mmx_available() { + return 1; +} +/* MinGW does not seem to ship with MMX or it is broken. + */ +void increment_mmx(float arr[4]) { + arr[0]++; + arr[1]++; + arr[2]++; + arr[3]++; +} #else #include<mmintrin.h> #include<cpuid.h> @@ -30,12 +40,13 @@ void increment_mmx(float arr[4]) { /* Super ugly but we know that values in arr are always small * enough to fit in int16; */ + int i; __m64 packed = _mm_set_pi16(arr[3], arr[2], arr[1], arr[0]); __m64 incr = _mm_set1_pi16(1); __m64 result = _mm_add_pi16(packed, incr); int64_t unpacker = _m_to_int64(result); _mm_empty(); - for(int i=0; i<4; i++) { + for(i=0; i<4; i++) { arr[i] = (float)(unpacker & ((1<<16)-1)); unpacker >>= 16; } |