~pocl/pocl/trunk

« back to all changes in this revision

Viewing changes to lib/kernel/vecmathlib-pocl/log1p.cc

  • Committer: Erik Schnetter
  • Date: 2013-08-17 16:11:57 UTC
  • Revision ID: eschnetter@perimeterinstitute.ca-20130817161157-pco7u3hv98nbg2uk
Move pocl-specific Vecmathlib code into a separate subdirectory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Note: This file has been automatically generated. Do not modify.
 
2
 
 
3
#include "pocl-compat.h"
 
4
 
 
5
// log1p: ['VF'] -> VF
 
6
 
 
7
// log1p: VF=float
 
8
#if defined VECMATHLIB_HAVE_VEC_FLOAT_1
 
9
// Implement log1p by calling vecmathlib
 
10
float _cl_log1p(float x0)
 
11
{
 
12
  vecmathlib::realvec<float,1> y0 = bitcast<float,vecmathlib::realvec<float,1> >(x0);
 
13
  vecmathlib::realvec<float,1> r = vecmathlib::log1p(y0);
 
14
  return bitcast<vecmathlib::realvec<float,1>,float>((r));
 
15
}
 
16
#else
 
17
// Implement log1p by calling libm
 
18
float _cl_log1p(float x0)
 
19
{
 
20
  vecmathlib::realpseudovec<float,1> y0 = x0;
 
21
  vecmathlib::realpseudovec<float,1> r = log1p(y0);
 
22
  return (r)[0];
 
23
}
 
24
#endif
 
25
 
 
26
// log1p: VF=float2
 
27
#if defined VECMATHLIB_HAVE_VEC_FLOAT_2
 
28
// Implement log1p by calling vecmathlib
 
29
float2 _cl_log1p(float2 x0)
 
30
{
 
31
  vecmathlib::realvec<float,2> y0 = bitcast<float2,vecmathlib::realvec<float,2> >(x0);
 
32
  vecmathlib::realvec<float,2> r = vecmathlib::log1p(y0);
 
33
  return bitcast<vecmathlib::realvec<float,2>,float2>((r));
 
34
}
 
35
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
 
36
// Implement log1p by using a larger vector size
 
37
float4 _cl_log1p(float4);
 
38
float2 _cl_log1p(float2 x0)
 
39
{
 
40
  float4 y0 = bitcast<float2,float4>(x0);
 
41
  float4 r = _cl_log1p(y0);
 
42
  return bitcast<float4,float2>(r);
 
43
}
 
44
#else
 
45
// Implement log1p by splitting into a smaller vector size
 
46
float _cl_log1p(float);
 
47
float2 _cl_log1p(float2 x0)
 
48
{
 
49
  pair_float y0 = bitcast<float2,pair_float>(x0);
 
50
  pair_float r;
 
51
  r.lo = _cl_log1p(y0.lo);
 
52
  r.hi = _cl_log1p(y0.hi);
 
53
  pocl_static_assert(sizeof(pair_float) == sizeof(float2));
 
54
  return bitcast<pair_float,float2>(r);
 
55
}
 
56
#endif
 
57
 
 
58
// log1p: VF=float3
 
59
#if defined VECMATHLIB_HAVE_VEC_FLOAT_3
 
60
// Implement log1p by calling vecmathlib
 
61
float3 _cl_log1p(float3 x0)
 
62
{
 
63
  vecmathlib::realvec<float,3> y0 = bitcast<float3,vecmathlib::realvec<float,3> >(x0);
 
64
  vecmathlib::realvec<float,3> r = vecmathlib::log1p(y0);
 
65
  return bitcast<vecmathlib::realvec<float,3>,float3>((r));
 
66
}
 
67
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
 
68
// Implement log1p by using a larger vector size
 
69
float4 _cl_log1p(float4);
 
70
float3 _cl_log1p(float3 x0)
 
71
{
 
72
  float4 y0 = bitcast<float3,float4>(x0);
 
73
  float4 r = _cl_log1p(y0);
 
74
  return bitcast<float4,float3>(r);
 
75
}
 
76
#else
 
77
// Implement log1p by splitting into a smaller vector size
 
78
float2 _cl_log1p(float2);
 
79
float3 _cl_log1p(float3 x0)
 
80
{
 
81
  pair_float2 y0 = bitcast<float3,pair_float2>(x0);
 
82
  pair_float2 r;
 
83
  r.lo = _cl_log1p(y0.lo);
 
84
  r.hi = _cl_log1p(y0.hi);
 
85
  pocl_static_assert(sizeof(pair_float2) == sizeof(float3));
 
86
  return bitcast<pair_float2,float3>(r);
 
87
}
 
88
#endif
 
89
 
 
90
// log1p: VF=float4
 
91
#if defined VECMATHLIB_HAVE_VEC_FLOAT_4
 
92
// Implement log1p by calling vecmathlib
 
93
float4 _cl_log1p(float4 x0)
 
94
{
 
95
  vecmathlib::realvec<float,4> y0 = bitcast<float4,vecmathlib::realvec<float,4> >(x0);
 
96
  vecmathlib::realvec<float,4> r = vecmathlib::log1p(y0);
 
97
  return bitcast<vecmathlib::realvec<float,4>,float4>((r));
 
98
}
 
99
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
 
100
// Implement log1p by using a larger vector size
 
101
float8 _cl_log1p(float8);
 
102
float4 _cl_log1p(float4 x0)
 
103
{
 
104
  float8 y0 = bitcast<float4,float8>(x0);
 
105
  float8 r = _cl_log1p(y0);
 
106
  return bitcast<float8,float4>(r);
 
107
}
 
108
#else
 
109
// Implement log1p by splitting into a smaller vector size
 
110
float2 _cl_log1p(float2);
 
111
float4 _cl_log1p(float4 x0)
 
112
{
 
113
  pair_float2 y0 = bitcast<float4,pair_float2>(x0);
 
114
  pair_float2 r;
 
115
  r.lo = _cl_log1p(y0.lo);
 
116
  r.hi = _cl_log1p(y0.hi);
 
117
  pocl_static_assert(sizeof(pair_float2) == sizeof(float4));
 
118
  return bitcast<pair_float2,float4>(r);
 
119
}
 
120
#endif
 
121
 
 
122
// log1p: VF=float8
 
123
#if defined VECMATHLIB_HAVE_VEC_FLOAT_8
 
124
// Implement log1p by calling vecmathlib
 
125
float8 _cl_log1p(float8 x0)
 
126
{
 
127
  vecmathlib::realvec<float,8> y0 = bitcast<float8,vecmathlib::realvec<float,8> >(x0);
 
128
  vecmathlib::realvec<float,8> r = vecmathlib::log1p(y0);
 
129
  return bitcast<vecmathlib::realvec<float,8>,float8>((r));
 
130
}
 
131
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_16
 
132
// Implement log1p by using a larger vector size
 
133
float16 _cl_log1p(float16);
 
134
float8 _cl_log1p(float8 x0)
 
135
{
 
136
  float16 y0 = bitcast<float8,float16>(x0);
 
137
  float16 r = _cl_log1p(y0);
 
138
  return bitcast<float16,float8>(r);
 
139
}
 
140
#else
 
141
// Implement log1p by splitting into a smaller vector size
 
142
float4 _cl_log1p(float4);
 
143
float8 _cl_log1p(float8 x0)
 
144
{
 
145
  pair_float4 y0 = bitcast<float8,pair_float4>(x0);
 
146
  pair_float4 r;
 
147
  r.lo = _cl_log1p(y0.lo);
 
148
  r.hi = _cl_log1p(y0.hi);
 
149
  pocl_static_assert(sizeof(pair_float4) == sizeof(float8));
 
150
  return bitcast<pair_float4,float8>(r);
 
151
}
 
152
#endif
 
153
 
 
154
// log1p: VF=float16
 
155
#if defined VECMATHLIB_HAVE_VEC_FLOAT_16
 
156
// Implement log1p by calling vecmathlib
 
157
float16 _cl_log1p(float16 x0)
 
158
{
 
159
  vecmathlib::realvec<float,16> y0 = bitcast<float16,vecmathlib::realvec<float,16> >(x0);
 
160
  vecmathlib::realvec<float,16> r = vecmathlib::log1p(y0);
 
161
  return bitcast<vecmathlib::realvec<float,16>,float16>((r));
 
162
}
 
163
#else
 
164
// Implement log1p by splitting into a smaller vector size
 
165
float8 _cl_log1p(float8);
 
166
float16 _cl_log1p(float16 x0)
 
167
{
 
168
  pair_float8 y0 = bitcast<float16,pair_float8>(x0);
 
169
  pair_float8 r;
 
170
  r.lo = _cl_log1p(y0.lo);
 
171
  r.hi = _cl_log1p(y0.hi);
 
172
  pocl_static_assert(sizeof(pair_float8) == sizeof(float16));
 
173
  return bitcast<pair_float8,float16>(r);
 
174
}
 
175
#endif
 
176
 
 
177
#ifdef cl_khr_fp64
 
178
 
 
179
// log1p: VF=double
 
180
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_1
 
181
// Implement log1p by calling vecmathlib
 
182
double _cl_log1p(double x0)
 
183
{
 
184
  vecmathlib::realvec<double,1> y0 = bitcast<double,vecmathlib::realvec<double,1> >(x0);
 
185
  vecmathlib::realvec<double,1> r = vecmathlib::log1p(y0);
 
186
  return bitcast<vecmathlib::realvec<double,1>,double>((r));
 
187
}
 
188
#else
 
189
// Implement log1p by calling libm
 
190
double _cl_log1p(double x0)
 
191
{
 
192
  vecmathlib::realpseudovec<double,1> y0 = x0;
 
193
  vecmathlib::realpseudovec<double,1> r = log1p(y0);
 
194
  return (r)[0];
 
195
}
 
196
#endif
 
197
 
 
198
// log1p: VF=double2
 
199
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_2
 
200
// Implement log1p by calling vecmathlib
 
201
double2 _cl_log1p(double2 x0)
 
202
{
 
203
  vecmathlib::realvec<double,2> y0 = bitcast<double2,vecmathlib::realvec<double,2> >(x0);
 
204
  vecmathlib::realvec<double,2> r = vecmathlib::log1p(y0);
 
205
  return bitcast<vecmathlib::realvec<double,2>,double2>((r));
 
206
}
 
207
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
 
208
// Implement log1p by using a larger vector size
 
209
double4 _cl_log1p(double4);
 
210
double2 _cl_log1p(double2 x0)
 
211
{
 
212
  double4 y0 = bitcast<double2,double4>(x0);
 
213
  double4 r = _cl_log1p(y0);
 
214
  return bitcast<double4,double2>(r);
 
215
}
 
216
#else
 
217
// Implement log1p by splitting into a smaller vector size
 
218
double _cl_log1p(double);
 
219
double2 _cl_log1p(double2 x0)
 
220
{
 
221
  pair_double y0 = bitcast<double2,pair_double>(x0);
 
222
  pair_double r;
 
223
  r.lo = _cl_log1p(y0.lo);
 
224
  r.hi = _cl_log1p(y0.hi);
 
225
  pocl_static_assert(sizeof(pair_double) == sizeof(double2));
 
226
  return bitcast<pair_double,double2>(r);
 
227
}
 
228
#endif
 
229
 
 
230
// log1p: VF=double3
 
231
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_3
 
232
// Implement log1p by calling vecmathlib
 
233
double3 _cl_log1p(double3 x0)
 
234
{
 
235
  vecmathlib::realvec<double,3> y0 = bitcast<double3,vecmathlib::realvec<double,3> >(x0);
 
236
  vecmathlib::realvec<double,3> r = vecmathlib::log1p(y0);
 
237
  return bitcast<vecmathlib::realvec<double,3>,double3>((r));
 
238
}
 
239
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
 
240
// Implement log1p by using a larger vector size
 
241
double4 _cl_log1p(double4);
 
242
double3 _cl_log1p(double3 x0)
 
243
{
 
244
  double4 y0 = bitcast<double3,double4>(x0);
 
245
  double4 r = _cl_log1p(y0);
 
246
  return bitcast<double4,double3>(r);
 
247
}
 
248
#else
 
249
// Implement log1p by splitting into a smaller vector size
 
250
double2 _cl_log1p(double2);
 
251
double3 _cl_log1p(double3 x0)
 
252
{
 
253
  pair_double2 y0 = bitcast<double3,pair_double2>(x0);
 
254
  pair_double2 r;
 
255
  r.lo = _cl_log1p(y0.lo);
 
256
  r.hi = _cl_log1p(y0.hi);
 
257
  pocl_static_assert(sizeof(pair_double2) == sizeof(double3));
 
258
  return bitcast<pair_double2,double3>(r);
 
259
}
 
260
#endif
 
261
 
 
262
// log1p: VF=double4
 
263
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_4
 
264
// Implement log1p by calling vecmathlib
 
265
double4 _cl_log1p(double4 x0)
 
266
{
 
267
  vecmathlib::realvec<double,4> y0 = bitcast<double4,vecmathlib::realvec<double,4> >(x0);
 
268
  vecmathlib::realvec<double,4> r = vecmathlib::log1p(y0);
 
269
  return bitcast<vecmathlib::realvec<double,4>,double4>((r));
 
270
}
 
271
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
 
272
// Implement log1p by using a larger vector size
 
273
double8 _cl_log1p(double8);
 
274
double4 _cl_log1p(double4 x0)
 
275
{
 
276
  double8 y0 = bitcast<double4,double8>(x0);
 
277
  double8 r = _cl_log1p(y0);
 
278
  return bitcast<double8,double4>(r);
 
279
}
 
280
#else
 
281
// Implement log1p by splitting into a smaller vector size
 
282
double2 _cl_log1p(double2);
 
283
double4 _cl_log1p(double4 x0)
 
284
{
 
285
  pair_double2 y0 = bitcast<double4,pair_double2>(x0);
 
286
  pair_double2 r;
 
287
  r.lo = _cl_log1p(y0.lo);
 
288
  r.hi = _cl_log1p(y0.hi);
 
289
  pocl_static_assert(sizeof(pair_double2) == sizeof(double4));
 
290
  return bitcast<pair_double2,double4>(r);
 
291
}
 
292
#endif
 
293
 
 
294
// log1p: VF=double8
 
295
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_8
 
296
// Implement log1p by calling vecmathlib
 
297
double8 _cl_log1p(double8 x0)
 
298
{
 
299
  vecmathlib::realvec<double,8> y0 = bitcast<double8,vecmathlib::realvec<double,8> >(x0);
 
300
  vecmathlib::realvec<double,8> r = vecmathlib::log1p(y0);
 
301
  return bitcast<vecmathlib::realvec<double,8>,double8>((r));
 
302
}
 
303
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_16
 
304
// Implement log1p by using a larger vector size
 
305
double16 _cl_log1p(double16);
 
306
double8 _cl_log1p(double8 x0)
 
307
{
 
308
  double16 y0 = bitcast<double8,double16>(x0);
 
309
  double16 r = _cl_log1p(y0);
 
310
  return bitcast<double16,double8>(r);
 
311
}
 
312
#else
 
313
// Implement log1p by splitting into a smaller vector size
 
314
double4 _cl_log1p(double4);
 
315
double8 _cl_log1p(double8 x0)
 
316
{
 
317
  pair_double4 y0 = bitcast<double8,pair_double4>(x0);
 
318
  pair_double4 r;
 
319
  r.lo = _cl_log1p(y0.lo);
 
320
  r.hi = _cl_log1p(y0.hi);
 
321
  pocl_static_assert(sizeof(pair_double4) == sizeof(double8));
 
322
  return bitcast<pair_double4,double8>(r);
 
323
}
 
324
#endif
 
325
 
 
326
// log1p: VF=double16
 
327
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_16
 
328
// Implement log1p by calling vecmathlib
 
329
double16 _cl_log1p(double16 x0)
 
330
{
 
331
  vecmathlib::realvec<double,16> y0 = bitcast<double16,vecmathlib::realvec<double,16> >(x0);
 
332
  vecmathlib::realvec<double,16> r = vecmathlib::log1p(y0);
 
333
  return bitcast<vecmathlib::realvec<double,16>,double16>((r));
 
334
}
 
335
#else
 
336
// Implement log1p by splitting into a smaller vector size
 
337
double8 _cl_log1p(double8);
 
338
double16 _cl_log1p(double16 x0)
 
339
{
 
340
  pair_double8 y0 = bitcast<double16,pair_double8>(x0);
 
341
  pair_double8 r;
 
342
  r.lo = _cl_log1p(y0.lo);
 
343
  r.hi = _cl_log1p(y0.hi);
 
344
  pocl_static_assert(sizeof(pair_double8) == sizeof(double16));
 
345
  return bitcast<pair_double8,double16>(r);
 
346
}
 
347
#endif
 
348
 
 
349
#endif // #ifdef cl_khr_fp64