gcc/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-check.h
blobbeb1b7d24f4cbb6ce07bee56d010c470b4501566
1 #include <stdlib.h>
3 /* Define this to enable the combination of VSX vector double and
4 SSE2 data types. */
5 #define __VSX_SSE2__ 1
7 #include "m128-check.h"
9 /* define DEBUG replace abort with printf on error. */
10 //#define DEBUG 1
12 #if 1
14 #define TEST sse2_test
16 static void sse2_test (void);
18 static void
19 __attribute__ ((noinline))
20 do_test (void)
22 sse2_test ();
25 int
26 main ()
28 #ifdef __BUILTIN_CPU_SUPPORTS__
29 /* Most SSE2 (vector double) intrinsic operations require VSX
30 instructions, but some operations may need only VMX
31 instructions. This also true for SSE2 scalar doubles as they
32 imply that "other half" of the vector remains unchanged or set
33 to zeros. The VSX scalar operations leave ther "other half"
34 undefined, and require additional merge operations.
35 Some conversions (to/from integer) need the direct register
36 transfer instructions from POWER8 for best performance.
37 So we test for arch_2_07. */
38 if ( __builtin_cpu_supports ("arch_2_07") )
40 do_test ();
41 #ifdef DEBUG
42 printf ("PASSED\n");
43 #endif
45 #ifdef DEBUG
46 else
47 printf ("SKIPPED\n");
48 #endif
49 #endif /* __BUILTIN_CPU_SUPPORTS__ */
50 return 0;
52 #endif