3 /* Test PowerPC SPU extensions. */
5 #define vector __attribute__((vector_size(8)))
7 vector
unsigned short f_vec
;
11 vector
unsigned int l_vec
;
15 /* dummy variables used in the testfile */
16 vector
unsigned int a_vec_d
= {1, 1};
17 vector
int b_vec_d
= {0, 0};
18 vector
float c_vec_d
= {1.0, 1.0};
19 vector
unsigned int d_vec_d
= {0, 0};
20 vector
int e_vec_d
= {1, 1};
21 vector
unsigned short f_vec_d
= {1, 1, 1, 1};
22 vector
short g_vec_d
= {1, 1, 1, 1};
23 vector
float h_vec_d
= {1.0, 1.0};
24 vector
float i_vec_d
= {2.0, 2.0};
25 vector
unsigned int l_vec_d
= {0, 0};
26 vector
int m_vec_d
= {0, 0};
30 vec_func (vector
unsigned int a_vec_f
,
33 vector
unsigned int d_vec_f
,
35 vector
unsigned short f_vec_f
,
39 vector
unsigned int l_vec_f
,
51 n_vec
= __ev_and(a_vec_f
, b_vec_f
);
52 n_vec
= __ev_or(c_vec_f
, d_vec_f
);
53 n_vec
= __ev_or(e_vec_f
, f_vec_f
);
54 n_vec
= __ev_and(g_vec_f
, h_vec_f
);
55 n_vec
= __ev_and(i_vec_f
, l_vec_f
);
56 n_vec
= __ev_or(m_vec_f
, a_vec_f
);
66 vector
unsigned int a_vec
;
69 vector
unsigned int d_vec
;
74 a_vec
= (vector
unsigned int)__ev_create_u64 ((uint64_t) 55);
75 b_vec
= __ev_create_s64 ((int64_t) 66);
76 c_vec
= (vector
float) __ev_create_fs (3.14F
, 2.18F
);
77 d_vec
= (vector
unsigned int) __ev_create_u32 ((uint32_t) 5, (uint32_t) 4);
78 e_vec
= (vector
int) __ev_create_s32 ((int32_t) 5, (int32_t) 6);
79 f_vec
= (vector
unsigned short) __ev_create_u16 ((uint16_t) 6, (uint16_t) 6, (uint16_t) 7, (uint16_t) 1);
80 g_vec
= (vector
short) __ev_create_s16 ((int16_t) 6, (int16_t) 6, (int16_t) 7, (int16_t) 9);
81 h_vec
= (vector
float) __ev_create_sfix32_fs (3.0F
, 2.0F
);
82 i_vec
= (vector
float) __ev_create_ufix32_fs (3.0F
, 2.0F
);
83 l_vec
= (vector
unsigned int) __ev_create_ufix32_u32 (3U, 5U);
84 m_vec
= (vector
int) __ev_create_sfix32_s32 (6, 9);
89 /* This line is useful for cut-n-paste from a gdb session. */
90 vec_func(a_vec
,b_vec
,c_vec
,d_vec
,e_vec
,f_vec
,g_vec
,h_vec
,i_vec
,l_vec
,m_vec
)
93 res_vec
= vec_func (a_vec
, /* goes in r3 */
94 b_vec
, /* goes in r4 */
95 c_vec
, /* goes in r5 */
96 d_vec
, /* goes in r6 */
97 e_vec
, /* goes in r7 */
98 f_vec
, /* goes in r8 */
99 g_vec
, /* goes in r9 */
100 h_vec
, /* goes in r10 */
101 i_vec
, /* goes in stack */
102 l_vec
, /* goes in stack */
103 m_vec
); /* goes in stack */