OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [vsx-builtin-4.c] - Blame information for rev 859

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 322 jeremybenn
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
2
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3
/* { dg-require-effective-target powerpc_vsx_ok } */
4
/* { dg-options "-O2 -mcpu=power7" } */
5
/* { dg-final { scan-assembler "xvcmpeqdp." } } */
6
/* { dg-final { scan-assembler "xvcmpgtdp." } } */
7
/* { dg-final { scan-assembler "xvcmpgedp." } } */
8
/* { dg-final { scan-assembler "xvcmpeqsp." } } */
9
/* { dg-final { scan-assembler "xvcmpgtsp." } } */
10
/* { dg-final { scan-assembler "xvcmpgesp." } } */
11
/* { dg-final { scan-assembler "vcmpbfp." } } */
12
/* { dg-final { scan-assembler "vcmpequb." } } */
13
/* { dg-final { scan-assembler "vcmpequh." } } */
14
/* { dg-final { scan-assembler "vcmpequw." } } */
15
/* { dg-final { scan-assembler "vcmpgtub." } } */
16
/* { dg-final { scan-assembler "vcmpgtuh." } } */
17
/* { dg-final { scan-assembler "vcmpgtuw." } } */
18
/* { dg-final { scan-assembler "vcmpgtsb." } } */
19
/* { dg-final { scan-assembler "vcmpgtsh." } } */
20
/* { dg-final { scan-assembler "vcmpgtsw." } } */
21
/* { dg-final { scan-assembler-not "vcmpeqfp" } } */
22
/* { dg-final { scan-assembler-not "vcmpgtfp" } } */
23
/* { dg-final { scan-assembler-not "vcmpgefp" } } */
24
 
25
/* check that Altivec builtins generate VSX if -mvsx.  */
26
 
27
#include <altivec.h>
28
 
29
int *v16qi_s (vector signed char *a, vector signed char *b, int *p)
30
{
31
  if (vec_all_eq (*a, *b))
32
    *p++ = 1;
33
 
34
  if (vec_all_gt (*a, *b))
35
    *p++ = 2;
36
 
37
  if (vec_all_ge (*a, *b))
38
    *p++ = 2;
39
 
40
  return p;
41
}
42
 
43
int *v16qi_u (vector unsigned char *a, vector unsigned char *b, int *p)
44
{
45
  if (vec_all_eq (*a, *b))
46
    *p++ = 1;
47
 
48
  if (vec_all_gt (*a, *b))
49
    *p++ = 2;
50
 
51
  if (vec_all_ge (*a, *b))
52
    *p++ = 2;
53
 
54
  return p;
55
}
56
 
57
int *v8hi_s (vector short *a, vector short *b, int *p)
58
{
59
  if (vec_all_eq (*a, *b))
60
    *p++ = 1;
61
 
62
  if (vec_all_gt (*a, *b))
63
    *p++ = 2;
64
 
65
  if (vec_all_ge (*a, *b))
66
    *p++ = 2;
67
 
68
  return p;
69
}
70
 
71
int *v8hi_u (vector unsigned short *a, vector unsigned short *b, int *p)
72
{
73
  if (vec_all_eq (*a, *b))
74
    *p++ = 1;
75
 
76
  if (vec_all_gt (*a, *b))
77
    *p++ = 2;
78
 
79
  if (vec_all_ge (*a, *b))
80
    *p++ = 2;
81
 
82
  return p;
83
}
84
 
85
int *v4si_s (vector int *a, vector int *b, int *p)
86
{
87
  if (vec_all_eq (*a, *b))
88
    *p++ = 1;
89
 
90
  if (vec_all_gt (*a, *b))
91
    *p++ = 2;
92
 
93
  if (vec_all_ge (*a, *b))
94
    *p++ = 2;
95
 
96
  return p;
97
}
98
 
99
int *v4si_u (vector unsigned int *a, vector unsigned int *b, int *p)
100
{
101
  if (vec_all_eq (*a, *b))
102
    *p++ = 1;
103
 
104
  if (vec_all_gt (*a, *b))
105
    *p++ = 2;
106
 
107
  if (vec_all_ge (*a, *b))
108
    *p++ = 2;
109
 
110
  return p;
111
}
112
 
113
int *v4sf (vector float *a, vector float *b, int *p)
114
{
115
  if (vec_all_eq (*a, *b))
116
    *p++ = 1;
117
 
118
  if (vec_all_gt (*a, *b))
119
    *p++ = 2;
120
 
121
  if (vec_all_ge (*a, *b))
122
    *p++ = 3;
123
 
124
  if (vec_all_in (*a, *b))      /* veccmpbfp. */
125
    *p++ = 4;
126
 
127
  return p;
128
}
129
 
130
int *v2df (vector double *a, vector double *b, int *p)
131
{
132
  if (vec_all_eq (*a, *b))
133
    *p++ = 1;
134
 
135
  if (vec_all_gt (*a, *b))
136
    *p++ = 2;
137
 
138
  if (vec_all_ge (*a, *b))
139
    *p++ = 3;
140
 
141
  return p;
142
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.