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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } } */
/* { dg-require-effective-target powerpc_p8vector_ok } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
/* { dg-options "-mcpu=power8 -O3 -mvsx-timode -mlra" } */
#include <altivec.h>
#ifndef TYPE
#define TYPE vector __int128_t
#endif
TYPE
do_addcuq (TYPE p, TYPE q)
{
return __builtin_vec_vaddcuq (p, q);
}
TYPE
do_adduqm (TYPE p, TYPE q)
{
return __builtin_vec_add (p, q);
}
TYPE
do_addeuqm (TYPE p, TYPE q, TYPE r)
{
return __builtin_vec_vaddeuqm (p, q, r);
}
TYPE
do_addecuq (TYPE p, TYPE q, TYPE r)
{
return __builtin_vec_vaddecuq (p, q, r);
}
TYPE
do_subeuqm (TYPE p, TYPE q, TYPE r)
{
return __builtin_vec_vsubeuqm (p, q, r);
}
TYPE
do_subecuq (TYPE p, TYPE q, TYPE r)
{
return __builtin_vec_vsubecuq (p, q, r);
}
TYPE
do_subcuq (TYPE p, TYPE q)
{
return __builtin_vec_vsubcuq (p, q);
}
TYPE
do_subuqm (TYPE p, TYPE q)
{
return __builtin_vec_vsubuqm (p, q);
}
TYPE
do_zero (void)
{
return (TYPE) { 0 };
}
TYPE
do_minus_one (void)
{
return (TYPE) { -1 };
}
/* { dg-final { scan-assembler "vaddcuq" } } */
/* { dg-final { scan-assembler "vadduqm" } } */
/* { dg-final { scan-assembler "vaddecuq" } } */
/* { dg-final { scan-assembler "vaddeuqm" } } */
/* { dg-final { scan-assembler "vsubecuq" } } */
/* { dg-final { scan-assembler "vsubeuqm" } } */
/* { dg-final { scan-assembler "vsubcuq" } } */
/* { dg-final { scan-assembler "vsubuqm" } } */
/* { dg-final { scan-assembler-not "mtvsrd" } } */
/* { dg-final { scan-assembler-not "mfvsrd" } } */
/* { dg-final { scan-assembler-not "ori 2,2,0" } } */
/* { dg-final { scan-assembler-not "xxpermdi" } } */
/* { dg-final { scan-assembler-not "stxvd2x" } } */
/* { dg-final { scan-assembler-not "stxvw4x" } } */
|