]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c
Get rid of dg-skip-if etc. default args
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / powerpc / vsx-builtin-8.c
CommitLineData
c9485473 1/* { dg-do compile { target { powerpc*-*-* } } } */
4f4b0ab8 2/* { dg-skip-if "" { powerpc*-*-darwin* } } */
c9485473 3/* { dg-require-effective-target powerpc_vsx_ok } */
a5fc83a1 4/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
264f4afa 5/* { dg-options "-O3 -mcpu=power7 -Wno-deprecated" } */
c9485473
MM
6
7/* Test the various load/store varients. */
8
9#include <altivec.h>
10
11#define TEST_COPY(NAME, TYPE) \
12void NAME ## _copy_native (vector TYPE *a, vector TYPE *b) \
13{ \
14 *a = *b; \
15} \
16 \
17void NAME ## _copy_vec (vector TYPE *a, vector TYPE *b) \
18{ \
19 vector TYPE x = vec_ld (0, b); \
20 vec_st (x, 0, a); \
21} \
22
23#define TEST_COPYL(NAME, TYPE) \
24void NAME ## _lvxl (vector TYPE *a, vector TYPE *b) \
25{ \
26 vector TYPE x = vec_ldl (0, b); \
27 vec_stl (x, 0, a); \
28} \
29
30#define TEST_VSX_COPY(NAME, TYPE) \
31void NAME ## _copy_vsx (vector TYPE *a, vector TYPE *b) \
32{ \
33 vector TYPE x = vec_vsx_ld (0, b); \
34 vec_vsx_st (x, 0, a); \
35} \
36
37#define TEST_ALIGN(NAME, TYPE) \
38void NAME ## _align (vector unsigned char *a, TYPE *b) \
39{ \
40 vector unsigned char x = vec_lvsl (0, b); \
41 vector unsigned char y = vec_lvsr (0, b); \
42 vec_st (x, 0, a); \
43 vec_st (y, 8, a); \
44}
45
46#ifndef NO_COPY
47TEST_COPY(uchar, unsigned char)
48TEST_COPY(schar, signed char)
49TEST_COPY(bchar, bool char)
50TEST_COPY(ushort, unsigned short)
51TEST_COPY(sshort, signed short)
52TEST_COPY(bshort, bool short)
53TEST_COPY(uint, unsigned int)
54TEST_COPY(sint, signed int)
55TEST_COPY(bint, bool int)
56TEST_COPY(float, float)
57TEST_COPY(double, double)
58#endif /* NO_COPY */
59
60#ifndef NO_COPYL
61TEST_COPYL(uchar, unsigned char)
62TEST_COPYL(schar, signed char)
63TEST_COPYL(bchar, bool char)
64TEST_COPYL(ushort, unsigned short)
65TEST_COPYL(sshort, signed short)
66TEST_COPYL(bshort, bool short)
67TEST_COPYL(uint, unsigned int)
68TEST_COPYL(sint, signed int)
69TEST_COPYL(bint, bool int)
70TEST_COPYL(float, float)
71TEST_COPYL(double, double)
72#endif /* NO_COPYL */
73
74#ifndef NO_ALIGN
75TEST_ALIGN(uchar, unsigned char)
76TEST_ALIGN(schar, signed char)
77TEST_ALIGN(ushort, unsigned short)
78TEST_ALIGN(sshort, signed short)
79TEST_ALIGN(uint, unsigned int)
80TEST_ALIGN(sint, signed int)
81TEST_ALIGN(float, float)
82TEST_ALIGN(double, double)
83#endif /* NO_ALIGN */
84
85
86#ifndef NO_VSX_COPY
87TEST_VSX_COPY(uchar, unsigned char)
88TEST_VSX_COPY(schar, signed char)
89TEST_VSX_COPY(bchar, bool char)
90TEST_VSX_COPY(ushort, unsigned short)
91TEST_VSX_COPY(sshort, signed short)
92TEST_VSX_COPY(bshort, bool short)
93TEST_VSX_COPY(uint, unsigned int)
94TEST_VSX_COPY(sint, signed int)
95TEST_VSX_COPY(bint, bool int)
96TEST_VSX_COPY(float, float)
97TEST_VSX_COPY(double, double)
98#endif /* NO_VSX_COPY */