summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/bcd-2.c
blob: c6e1886b5658584a68944d1ceeba3655cf745c85 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-skip-if "" { powerpc*-*-*spe* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
/* { dg-options "-mcpu=power8 -O2" } */
/* { dg-final { scan-assembler-times "bcdadd\[.\] " 2 } } */
/* { dg-final { scan-assembler-times "bcdsub\[.\] " 2 } } */
/* { dg-final { scan-assembler-not   "bl __builtin"   } } */
/* { dg-final { scan-assembler-not   "mtvsr"   	      } } */
/* { dg-final { scan-assembler-not   "mfvsr"   	      } } */
/* { dg-final { scan-assembler-not   "lvx"     	      } } */
/* { dg-final { scan-assembler-not   "lxvw4x"  	      } } */
/* { dg-final { scan-assembler-not   "lxvd2x"  	      } } */
/* { dg-final { scan-assembler-not   "stvx"    	      } } */
/* { dg-final { scan-assembler-not   "stxvw4x" 	      } } */
/* { dg-final { scan-assembler-not   "stxvd2x" 	      } } */

typedef __int128_t __attribute__((__vector_size__(16)))	vector_128_t;
typedef __int128_t					scalar_128_t;
typedef	unsigned long long				scalar_64_t;

vector_128_t
do_add_0 (vector_128_t a, vector_128_t b)
{
  return __builtin_bcdadd (a, b, 0);
}

vector_128_t
do_add_1 (vector_128_t a, vector_128_t b)
{
  return __builtin_bcdadd (a, b, 1);
}

vector_128_t
do_sub_0 (vector_128_t a, vector_128_t b)
{
  return __builtin_bcdsub (a, b, 0);
}

vector_128_t
do_sub_1 (vector_128_t a, vector_128_t b)
{
  return __builtin_bcdsub (a, b, 1);
}