Skip to content

Commit 438aad3

Browse files
committed
SIMD1 test requires an architecture with MMX
The SIMD1 test uses an include that uses MMX intrinsics, which are only available on Intel x86 architectures. This commit adds preprocessor checks to prevent the test to fail on other architectures.
1 parent 197c68c commit 438aad3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

regression/cbmc/SIMD1/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
# define _mm_extract_pi16(a, b) _mm_extract_epi16(a, b)
88
# endif
99
#else
10-
# include <immintrin.h>
10+
# ifdef __MMX__
11+
# include <immintrin.h>
12+
# endif
1113
#endif
1214

1315
int main()
1416
{
17+
#if defined(_MSC_VER) || defined(__MMX__)
1518
__m128i values = _mm_setr_epi32(0x1234, 0x2345, 0x3456, 0x4567);
1619
int val1 = _mm_extract_epi32(values, 0);
1720
assert(val1 == 0x1234);
@@ -53,6 +56,7 @@ int main()
5356
__m128i result128 = _mm_subs_epu16(x, y);
5457
short s = _mm_extract_epi16(result128, 0);
5558
assert(s == 0);
59+
#endif
5660

5761
return 0;
5862
}

0 commit comments

Comments
 (0)