PR target/80969 - Fix ICE with -mabi=ms -mavx512f, reduce wasted space when realignin...
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-cvt-1.c
blob4d5683108dc06c3e5a5fabe0cbdbc9f2b963859a
1 /* { dg-do run } */
2 /* { dg-options "-O3 -msse2 -mno-avx" } */
3 /* { dg-require-effective-target sse2 } */
5 #ifndef CHECK_H
6 #define CHECK_H "sse2-check.h"
7 #endif
9 #ifndef TEST
10 #define TEST sse2_test
11 #endif
13 #include CHECK_H
15 #define N 16
16 float f[N];
17 double d[N];
18 int n[N];
20 __attribute__((noinline)) void
21 f1 (void)
23 int i;
24 for (i = 0; i < N; i++)
25 n[i] = d[i];
28 __attribute__((noinline)) void
29 f2 (void)
31 int i;
32 for (i = 0; i < N; i++)
33 f[i] = n[i];
36 __attribute__((noinline)) void
37 f3 (void)
39 int i;
40 for (i = 0; i < N; i++)
41 d[i] = f[i];
44 __attribute__((noinline)) void
45 f4 (void)
47 int i;
48 for (i = 0; i < N; i++)
49 n[i] = f[i];
52 __attribute__((noinline)) void
53 f5 (void)
55 int i;
56 for (i = 0; i < N; i++)
57 d[i] = n[i];
60 __attribute__((noinline)) void
61 f6 (void)
63 int i;
64 for (i = 0; i < N; i++)
65 f[i] = d[i];
68 static void
69 TEST ()
71 int i;
72 for (i = 0; i < N; i++)
74 asm ("");
75 d[i] = i + 2.5;
77 f1 ();
78 for (i = 0; i < N; i++)
79 if (n[i] != i + 2)
80 abort ();
81 else
82 n[i] = i + 7;
83 f2 ();
84 for (i = 0; i < N; i++)
85 if (f[i] != i + 7)
86 abort ();
87 else
88 f[i] = i - 2.25f;
89 f3 ();
90 for (i = 0; i < N; i++)
91 if (d[i] != i - 2.25)
92 abort ();
93 else
94 f[i] = i + 3.5;
95 f4 ();
96 for (i = 0; i < N; i++)
97 if (n[i] != i + 3)
98 abort ();
99 else
100 n[i] = i + 9;
101 f5 ();
102 for (i = 0; i < N; i++)
103 if (d[i] != i + 9)
104 abort ();
105 else
106 d[i] = i - 7.25;
107 f6 ();
108 for (i = 0; i < N; i++)
109 if (f[i] != i - 7.25)
110 abort ();