1 /* { dg-do run { target bfin*-*-* } } */
2 /* { dg-options "-O2" } */
3 #include <stdlib.h>
4 typedef short raw2x16 __attribute__ ((vector_size(4)));
5
6 int x;
7
ll(raw2x16 a,raw2x16 b)8 int ll(raw2x16 a, raw2x16 b)
9 {
10 x = __builtin_bfin_mulhisill(a, b);
11 return x;
12 }
13
lh(raw2x16 a,raw2x16 b)14 int lh(raw2x16 a, raw2x16 b)
15 {
16 x = __builtin_bfin_mulhisilh(a, b);
17 return x;
18 }
19
hl(raw2x16 a,raw2x16 b)20 int hl(raw2x16 a, raw2x16 b)
21 {
22 x = __builtin_bfin_mulhisihl(a, b);
23 return x;
24 }
25
hh(raw2x16 a,raw2x16 b)26 int hh(raw2x16 a, raw2x16 b)
27 {
28 x = __builtin_bfin_mulhisihh(a, b);
29 return x;
30 }
31
main()32 int main ()
33 {
34 raw2x16 a = __builtin_bfin_compose_2x16 (0x1234, 0x5678);
35 raw2x16 b = __builtin_bfin_compose_2x16 (0xFEDC, 0xBA98);
36 if (ll (a, b) != 0xe88e8740)
37 abort ();
38 if (lh (a, b) != 0xff9d5f20)
39 abort ();
40 if (hl (a, b) != 0xfb1096e0)
41 abort ();
42 if (hh (a, b) != 0xffeb3cb0)
43 abort ();
44
45 return 0;
46 }
47