Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / mips / mips32-dsp-type.c
blob2a901bbf38e2e0b170b07f14e2f2318ab72d5ce6
1 /* Test MIPS32 DSP instructions */
2 /* { dg-do compile } */
3 /* { dg-options "-mdsp" } */
4 /* { dg-final { scan-assembler "\taddq.ph\t" } } */
5 /* { dg-final { scan-assembler "\taddu.qb\t" } } */
6 /* { dg-final { scan-assembler "\tsubq.ph\t" } } */
7 /* { dg-final { scan-assembler "\tsubu.qb\t" } } */
9 typedef char v4qi __attribute__ ((vector_size(4)));
10 typedef short v2hi __attribute__ ((vector_size(4)));
12 NOMIPS16 v2hi add_v2hi (v2hi a, v2hi b)
14 return a + b;
17 NOMIPS16 v4qi add_v4qi (v4qi a, v4qi b)
19 return a + b;
22 NOMIPS16 v2hi sub_v2hi (v2hi a, v2hi b)
24 return a - b;
27 NOMIPS16 v4qi sub_v4qi (v4qi a, v4qi b)
29 return a - b;