Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/altivec_vld_vst_addr-2.c

raw
1 /* { dg-options "-mvsx" } */
2 /* { dg-require-effective-target powerpc_vsx } */
3
4 /* Note that vector long long and vector double type require vsx support. */
5
6 /* Test vec_ld and vec_st can support both scalar and vector
7 type address points, the list is:
8 - address of unsigned long long
9 - address of signed long long
10 - address of double
11 - address of vector unsigned long long
12 - address of vector signed long long
13 - address of vector double */
14 #include <altivec.h>
15
16 /* Test vec_ld can allow scalar and vector type address. */
17
18 vector unsigned long long
19 test_vld_scalar_ul (const unsigned long long *address)
20 {
21 return __builtin_vec_ld (0, address);
22 }
23
24 vector signed long long
25 test_vld_scalar_sl (const signed long long *address)
26 {
27 return __builtin_vec_ld (0, address);
28 }
29
30 vector double
31 test_vld_scalar_d (const double *address)
32 {
33 return __builtin_vec_ld (0, address);
34 }
35
36 vector unsigned long long
37 test_vld_vector_ul (const vector unsigned long long *address)
38 {
39 return __builtin_vec_ld (0, address);
40 }
41
42 vector signed long long
43 test_vld_vector_sl (const vector signed long long *address)
44 {
45 return __builtin_vec_ld (0, address);
46 }
47
48 vector double
49 test_vld_vector_d (const vector double *address)
50 {
51 return __builtin_vec_ld (0, address);
52 }
53
54 /* Test vec_st can allow scalar and vector type address. */
55
56 void
57 test_vst_scalar_ul (vector unsigned long long v, unsigned long long *address)
58 {
59 __builtin_vec_st (v, 0, address);
60 }
61
62 void
63 test_vst_scalar_sl (vector signed long long v, signed long long *address)
64 {
65 __builtin_vec_st (v, 0, address);
66 }
67
68 void
69 test_vst_scalar_d (vector double v, double *address)
70 {
71 __builtin_vec_st (v, 0, address);
72 }
73
74 void
75 test_vst_vector_ul (vector unsigned long long v,
76 vector unsigned long long *address)
77 {
78 __builtin_vec_st (v, 0, address);
79 }
80
81 void
82 test_vst_vector_sl (vector signed long long v, vector signed long long *address)
83 {
84 __builtin_vec_st (v, 0, address);
85 }
86
87 void
88 test_vst_vector_d (vector double v, vector double *address)
89 {
90 __builtin_vec_st (v, 0, address);
91 }
92