aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/mips/mips32-dsp-type.c
blob: 2a901bbf38e2e0b170b07f14e2f2318ab72d5ce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Test MIPS32 DSP instructions */
/* { dg-do compile } */
/* { dg-options "-mdsp" } */
/* { dg-final { scan-assembler "\taddq.ph\t" } } */
/* { dg-final { scan-assembler "\taddu.qb\t" } } */
/* { dg-final { scan-assembler "\tsubq.ph\t" } } */
/* { dg-final { scan-assembler "\tsubu.qb\t" } } */

typedef char v4qi __attribute__ ((vector_size(4)));
typedef short v2hi __attribute__ ((vector_size(4)));

NOMIPS16 v2hi add_v2hi (v2hi a, v2hi b)
{
  return a + b;
}

NOMIPS16 v4qi add_v4qi (v4qi a, v4qi b)
{
  return a + b;
}

NOMIPS16 v2hi sub_v2hi (v2hi a, v2hi b)
{
  return a - b;
}

NOMIPS16 v4qi sub_v4qi (v4qi a, v4qi b)
{
  return a - b;
}