summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sparc/combined-2.c
blob: c4b70a55a2d4a3f3871b7fc59a94b5c73798d66c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */
typedef unsigned char pixel __attribute__((vector_size(4)));
typedef unsigned char vec8 __attribute__((vector_size(8)));
typedef short vec16 __attribute__((vector_size(8)));

vec16 foo (pixel a, pixel b) {
  vec8 c = __builtin_vis_fpmerge (a, b);
  vec16 d = { -1, -1, -1, -1 };
  vec16 e = __builtin_vis_fmul8x16 (a, d);

  return e;
}

vec16 bar (pixel a) {
  vec16 d = { 0, 0, 0, 0 };
  vec16 e = __builtin_vis_fmul8x16 (a, d);  /* Mulitplication by 0 = 0.  */

  return e;
}

/* { dg-final { scan-assembler "fmul8x16" } } */
/* { dg-final { scan-assembler "fzero" } } */