Update ChangeLog and version files for release
[official-gcc.git] / gcc / testsuite / gcc.target / bfin / 20090914-1.c
blob1044540571023bd35efc3a91dd695a5b2da8eec2
1 /* { dg-do compile { target bfin-*-* } } */
3 typedef short __v2hi __attribute__ ((vector_size (4)));
4 typedef __v2hi raw2x16;
5 typedef raw2x16 fract2x16;
7 typedef short fract16;
8 typedef struct complex_fract16
10 fract16 re;
11 fract16 im;
12 } __attribute__ ((aligned (4))) complex_fract16;
14 typedef union composite_complex_fract16
16 struct complex_fract16 x;
17 long raw;
18 } composite_complex_fract16;
20 __inline__ __attribute__ ((always_inline))
21 static complex_fract16 cmsu_fr16 (complex_fract16 _sum,
22 complex_fract16 _a, complex_fract16 _b)
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;
35 composite_complex_fract16
36 f (complex_fract16 _sum, complex_fract16 _a, complex_fract16 _b)
38 return (composite_complex_fract16) cmsu_fr16 (_sum, _a, _b);