1 /* { dg-do compile { target bfin-*-* } } */
2 
3 typedef short __v2hi __attribute__ ((vector_size (4)));
4 typedef __v2hi raw2x16;
5 typedef raw2x16 fract2x16;
6 
7 typedef short fract16;
8 typedef struct complex_fract16
9 {
10   fract16 re;
11   fract16 im;
12 } __attribute__ ((aligned (4))) complex_fract16;
13 
14 typedef union composite_complex_fract16
15 {
16   struct complex_fract16 x;
17   long raw;
18 } composite_complex_fract16;
19 
20 __inline__ __attribute__ ((always_inline))
cmsu_fr16(complex_fract16 _sum,complex_fract16 _a,complex_fract16 _b)21 static complex_fract16 cmsu_fr16 (complex_fract16 _sum,
22 				  complex_fract16 _a, complex_fract16 _b)
23 {
24   complex_fract16 r;
25   fract2x16 i =
26     __builtin_bfin_cmplx_msu (__builtin_bfin_compose_2x16
27 			      ((_sum).im, (_sum).re),
28 			      __builtin_bfin_compose_2x16 ((_a).im, (_a).re),
29 			      __builtin_bfin_compose_2x16 ((_b).im, (_b).re));
30   (r).re = __builtin_bfin_extract_lo (i);
31   (r).im = __builtin_bfin_extract_hi (i);
32   return r;
33 }
34 
35 composite_complex_fract16
f(complex_fract16 _sum,complex_fract16 _a,complex_fract16 _b)36 f (complex_fract16 _sum, complex_fract16 _a, complex_fract16 _b)
37 {
38   return (composite_complex_fract16) cmsu_fr16 (_sum, _a, _b);
39 }
40