Remove outermost loop parameter.
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.target / i386 / avx-vcmpps-1.c
blob753f2ce64d0b5e0b9f9d7e9b86481a90c7356dd2
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx } */
3 /* { dg-options "-O2 -mavx -std=c99" } */
5 #include "avx-check.h"
6 #include <math.h>
8 float s1[4]={2134.3343,6678.346,453.345635,54646.464356};
9 float s2[4]={41124.234,6678.346,8653.65635,856.43576};
10 int e[4];
12 union
14 float f[4];
15 int i[4];
16 }d;
18 void check(unsigned imm, char *id)
20 if(checkVi(d.i, e, 4)){
21 printf("mm_cmp_ps(0x%x, %s) FAILED\n", imm, id);
25 static void
26 avx_test ()
28 __m128 source1, source2, dest;
29 int i;
31 #define CMP(imm, rel) \
32 for (i = 0; i < 4; i++) e[i] = rel ? -1 : 0; \
33 source1 = _mm_loadu_ps(s1); \
34 source2 = _mm_loadu_ps(s2); \
35 dest = _mm_cmp_ps(source1, source2, imm); \
36 _mm_storeu_ps(d.f, dest); \
37 check(imm, "" #imm "");
39 CMP(_CMP_EQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]);
40 CMP(_CMP_LT_OS, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]);
41 CMP(_CMP_LE_OS, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]);
42 CMP(_CMP_UNORD_Q, isunordered(s1[i], s2[i]));
43 CMP(_CMP_NEQ_UQ, isunordered(s1[i], s2[i]) || s1[i] != s2[i]);
44 CMP(_CMP_NLT_US, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]);
45 CMP(_CMP_NLE_US, isunordered(s1[i], s2[i]) || s1[i] > s2[i]);
46 CMP(_CMP_ORD_Q, !isunordered(s1[i], s2[i]));
48 CMP(_CMP_EQ_UQ, isunordered(s1[i], s2[i]) || s1[i] == s2[i]);
49 CMP(_CMP_NGE_US, isunordered(s1[i], s2[i]) || s1[i] < s2[i]);
50 CMP(_CMP_NGT_US, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]);
52 CMP(_CMP_FALSE_OQ, 0);
53 CMP(_CMP_NEQ_OQ, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]);
54 CMP(_CMP_GE_OS, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]);
55 CMP(_CMP_GT_OS, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]);
56 CMP(_CMP_TRUE_UQ, 1);
58 CMP(_CMP_EQ_OS, !isunordered(s1[i], s2[i]) && s1[i] == s2[i]);
59 CMP(_CMP_LT_OQ, !isunordered(s1[i], s2[i]) && s1[i] < s2[i]);
60 CMP(_CMP_LE_OQ, !isunordered(s1[i], s2[i]) && s1[i] <= s2[i]);
61 CMP(_CMP_UNORD_S, isunordered(s1[i], s2[i]));
62 CMP(_CMP_NEQ_US, isunordered(s1[i], s2[i]) || s1[i] != s2[i]);
63 CMP(_CMP_NLT_UQ, isunordered(s1[i], s2[i]) || s1[i] >= s2[i]);
64 CMP(_CMP_NLE_UQ, isunordered(s1[i], s2[i]) || s1[i] > s2[i]);
65 CMP(_CMP_ORD_S, !isunordered(s1[i], s2[i]));
66 CMP(_CMP_EQ_US, isunordered(s1[i], s2[i]) || s1[i] == s2[i]);
67 CMP(_CMP_NGE_UQ, isunordered(s1[i], s2[i]) || s1[i] < s2[i]);
68 CMP(_CMP_NGT_UQ, isunordered(s1[i], s2[i]) || s1[i] <= s2[i]);
69 CMP(_CMP_FALSE_OS, 0);
70 CMP(_CMP_NEQ_OS, !isunordered(s1[i], s2[i]) && s1[i] != s2[i]);
71 CMP(_CMP_GE_OQ, !isunordered(s1[i], s2[i]) && s1[i] >= s2[i]);
72 CMP(_CMP_GT_OQ, !isunordered(s1[i], s2[i]) && s1[i] > s2[i]);
73 CMP(_CMP_TRUE_US, 1);