1
// Note: This file has been automatically generated. Do not modify.
3
#include "pocl-compat.h"
8
#if defined VECMATHLIB_HAVE_VEC_FLOAT_1
9
// Implement sin by calling vecmathlib
10
float _cl_sin(float x0)
12
vecmathlib::realvec<float,1> y0 = bitcast<float,vecmathlib::realvec<float,1> >(x0);
13
vecmathlib::realvec<float,1> r = vecmathlib::sin(y0);
14
return bitcast<vecmathlib::realvec<float,1>,float>((r));
17
// Implement sin by calling libm
18
float _cl_sin(float x0)
20
vecmathlib::realpseudovec<float,1> y0 = x0;
21
vecmathlib::realpseudovec<float,1> r = sin(y0);
27
#if defined VECMATHLIB_HAVE_VEC_FLOAT_2
28
// Implement sin by calling vecmathlib
29
float2 _cl_sin(float2 x0)
31
vecmathlib::realvec<float,2> y0 = bitcast<float2,vecmathlib::realvec<float,2> >(x0);
32
vecmathlib::realvec<float,2> r = vecmathlib::sin(y0);
33
return bitcast<vecmathlib::realvec<float,2>,float2>((r));
35
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
36
// Implement sin by using a larger vector size
37
float4 _cl_sin(float4);
38
float2 _cl_sin(float2 x0)
40
float4 y0 = bitcast<float2,float4>(x0);
41
float4 r = _cl_sin(y0);
42
return bitcast<float4,float2>(r);
45
// Implement sin by splitting into a smaller vector size
47
float2 _cl_sin(float2 x0)
49
pair_float y0 = bitcast<float2,pair_float>(x0);
51
r.lo = _cl_sin(y0.lo);
52
r.hi = _cl_sin(y0.hi);
53
pocl_static_assert(sizeof(pair_float) == sizeof(float2));
54
return bitcast<pair_float,float2>(r);
59
#if defined VECMATHLIB_HAVE_VEC_FLOAT_3
60
// Implement sin by calling vecmathlib
61
float3 _cl_sin(float3 x0)
63
vecmathlib::realvec<float,3> y0 = bitcast<float3,vecmathlib::realvec<float,3> >(x0);
64
vecmathlib::realvec<float,3> r = vecmathlib::sin(y0);
65
return bitcast<vecmathlib::realvec<float,3>,float3>((r));
67
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
68
// Implement sin by using a larger vector size
69
float4 _cl_sin(float4);
70
float3 _cl_sin(float3 x0)
72
float4 y0 = bitcast<float3,float4>(x0);
73
float4 r = _cl_sin(y0);
74
return bitcast<float4,float3>(r);
77
// Implement sin by splitting into a smaller vector size
78
float2 _cl_sin(float2);
79
float3 _cl_sin(float3 x0)
81
pair_float2 y0 = bitcast<float3,pair_float2>(x0);
83
r.lo = _cl_sin(y0.lo);
84
r.hi = _cl_sin(y0.hi);
85
pocl_static_assert(sizeof(pair_float2) == sizeof(float3));
86
return bitcast<pair_float2,float3>(r);
91
#if defined VECMATHLIB_HAVE_VEC_FLOAT_4
92
// Implement sin by calling vecmathlib
93
float4 _cl_sin(float4 x0)
95
vecmathlib::realvec<float,4> y0 = bitcast<float4,vecmathlib::realvec<float,4> >(x0);
96
vecmathlib::realvec<float,4> r = vecmathlib::sin(y0);
97
return bitcast<vecmathlib::realvec<float,4>,float4>((r));
99
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
100
// Implement sin by using a larger vector size
101
float8 _cl_sin(float8);
102
float4 _cl_sin(float4 x0)
104
float8 y0 = bitcast<float4,float8>(x0);
105
float8 r = _cl_sin(y0);
106
return bitcast<float8,float4>(r);
109
// Implement sin by splitting into a smaller vector size
110
float2 _cl_sin(float2);
111
float4 _cl_sin(float4 x0)
113
pair_float2 y0 = bitcast<float4,pair_float2>(x0);
115
r.lo = _cl_sin(y0.lo);
116
r.hi = _cl_sin(y0.hi);
117
pocl_static_assert(sizeof(pair_float2) == sizeof(float4));
118
return bitcast<pair_float2,float4>(r);
123
#if defined VECMATHLIB_HAVE_VEC_FLOAT_8
124
// Implement sin by calling vecmathlib
125
float8 _cl_sin(float8 x0)
127
vecmathlib::realvec<float,8> y0 = bitcast<float8,vecmathlib::realvec<float,8> >(x0);
128
vecmathlib::realvec<float,8> r = vecmathlib::sin(y0);
129
return bitcast<vecmathlib::realvec<float,8>,float8>((r));
131
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_16
132
// Implement sin by using a larger vector size
133
float16 _cl_sin(float16);
134
float8 _cl_sin(float8 x0)
136
float16 y0 = bitcast<float8,float16>(x0);
137
float16 r = _cl_sin(y0);
138
return bitcast<float16,float8>(r);
141
// Implement sin by splitting into a smaller vector size
142
float4 _cl_sin(float4);
143
float8 _cl_sin(float8 x0)
145
pair_float4 y0 = bitcast<float8,pair_float4>(x0);
147
r.lo = _cl_sin(y0.lo);
148
r.hi = _cl_sin(y0.hi);
149
pocl_static_assert(sizeof(pair_float4) == sizeof(float8));
150
return bitcast<pair_float4,float8>(r);
155
#if defined VECMATHLIB_HAVE_VEC_FLOAT_16
156
// Implement sin by calling vecmathlib
157
float16 _cl_sin(float16 x0)
159
vecmathlib::realvec<float,16> y0 = bitcast<float16,vecmathlib::realvec<float,16> >(x0);
160
vecmathlib::realvec<float,16> r = vecmathlib::sin(y0);
161
return bitcast<vecmathlib::realvec<float,16>,float16>((r));
164
// Implement sin by splitting into a smaller vector size
165
float8 _cl_sin(float8);
166
float16 _cl_sin(float16 x0)
168
pair_float8 y0 = bitcast<float16,pair_float8>(x0);
170
r.lo = _cl_sin(y0.lo);
171
r.hi = _cl_sin(y0.hi);
172
pocl_static_assert(sizeof(pair_float8) == sizeof(float16));
173
return bitcast<pair_float8,float16>(r);
180
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_1
181
// Implement sin by calling vecmathlib
182
double _cl_sin(double x0)
184
vecmathlib::realvec<double,1> y0 = bitcast<double,vecmathlib::realvec<double,1> >(x0);
185
vecmathlib::realvec<double,1> r = vecmathlib::sin(y0);
186
return bitcast<vecmathlib::realvec<double,1>,double>((r));
189
// Implement sin by calling libm
190
double _cl_sin(double x0)
192
vecmathlib::realpseudovec<double,1> y0 = x0;
193
vecmathlib::realpseudovec<double,1> r = sin(y0);
199
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_2
200
// Implement sin by calling vecmathlib
201
double2 _cl_sin(double2 x0)
203
vecmathlib::realvec<double,2> y0 = bitcast<double2,vecmathlib::realvec<double,2> >(x0);
204
vecmathlib::realvec<double,2> r = vecmathlib::sin(y0);
205
return bitcast<vecmathlib::realvec<double,2>,double2>((r));
207
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
208
// Implement sin by using a larger vector size
209
double4 _cl_sin(double4);
210
double2 _cl_sin(double2 x0)
212
double4 y0 = bitcast<double2,double4>(x0);
213
double4 r = _cl_sin(y0);
214
return bitcast<double4,double2>(r);
217
// Implement sin by splitting into a smaller vector size
218
double _cl_sin(double);
219
double2 _cl_sin(double2 x0)
221
pair_double y0 = bitcast<double2,pair_double>(x0);
223
r.lo = _cl_sin(y0.lo);
224
r.hi = _cl_sin(y0.hi);
225
pocl_static_assert(sizeof(pair_double) == sizeof(double2));
226
return bitcast<pair_double,double2>(r);
231
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_3
232
// Implement sin by calling vecmathlib
233
double3 _cl_sin(double3 x0)
235
vecmathlib::realvec<double,3> y0 = bitcast<double3,vecmathlib::realvec<double,3> >(x0);
236
vecmathlib::realvec<double,3> r = vecmathlib::sin(y0);
237
return bitcast<vecmathlib::realvec<double,3>,double3>((r));
239
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
240
// Implement sin by using a larger vector size
241
double4 _cl_sin(double4);
242
double3 _cl_sin(double3 x0)
244
double4 y0 = bitcast<double3,double4>(x0);
245
double4 r = _cl_sin(y0);
246
return bitcast<double4,double3>(r);
249
// Implement sin by splitting into a smaller vector size
250
double2 _cl_sin(double2);
251
double3 _cl_sin(double3 x0)
253
pair_double2 y0 = bitcast<double3,pair_double2>(x0);
255
r.lo = _cl_sin(y0.lo);
256
r.hi = _cl_sin(y0.hi);
257
pocl_static_assert(sizeof(pair_double2) == sizeof(double3));
258
return bitcast<pair_double2,double3>(r);
263
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_4
264
// Implement sin by calling vecmathlib
265
double4 _cl_sin(double4 x0)
267
vecmathlib::realvec<double,4> y0 = bitcast<double4,vecmathlib::realvec<double,4> >(x0);
268
vecmathlib::realvec<double,4> r = vecmathlib::sin(y0);
269
return bitcast<vecmathlib::realvec<double,4>,double4>((r));
271
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
272
// Implement sin by using a larger vector size
273
double8 _cl_sin(double8);
274
double4 _cl_sin(double4 x0)
276
double8 y0 = bitcast<double4,double8>(x0);
277
double8 r = _cl_sin(y0);
278
return bitcast<double8,double4>(r);
281
// Implement sin by splitting into a smaller vector size
282
double2 _cl_sin(double2);
283
double4 _cl_sin(double4 x0)
285
pair_double2 y0 = bitcast<double4,pair_double2>(x0);
287
r.lo = _cl_sin(y0.lo);
288
r.hi = _cl_sin(y0.hi);
289
pocl_static_assert(sizeof(pair_double2) == sizeof(double4));
290
return bitcast<pair_double2,double4>(r);
295
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_8
296
// Implement sin by calling vecmathlib
297
double8 _cl_sin(double8 x0)
299
vecmathlib::realvec<double,8> y0 = bitcast<double8,vecmathlib::realvec<double,8> >(x0);
300
vecmathlib::realvec<double,8> r = vecmathlib::sin(y0);
301
return bitcast<vecmathlib::realvec<double,8>,double8>((r));
303
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_16
304
// Implement sin by using a larger vector size
305
double16 _cl_sin(double16);
306
double8 _cl_sin(double8 x0)
308
double16 y0 = bitcast<double8,double16>(x0);
309
double16 r = _cl_sin(y0);
310
return bitcast<double16,double8>(r);
313
// Implement sin by splitting into a smaller vector size
314
double4 _cl_sin(double4);
315
double8 _cl_sin(double8 x0)
317
pair_double4 y0 = bitcast<double8,pair_double4>(x0);
319
r.lo = _cl_sin(y0.lo);
320
r.hi = _cl_sin(y0.hi);
321
pocl_static_assert(sizeof(pair_double4) == sizeof(double8));
322
return bitcast<pair_double4,double8>(r);
327
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_16
328
// Implement sin by calling vecmathlib
329
double16 _cl_sin(double16 x0)
331
vecmathlib::realvec<double,16> y0 = bitcast<double16,vecmathlib::realvec<double,16> >(x0);
332
vecmathlib::realvec<double,16> r = vecmathlib::sin(y0);
333
return bitcast<vecmathlib::realvec<double,16>,double16>((r));
336
// Implement sin by splitting into a smaller vector size
337
double8 _cl_sin(double8);
338
double16 _cl_sin(double16 x0)
340
pair_double8 y0 = bitcast<double16,pair_double8>(x0);
342
r.lo = _cl_sin(y0.lo);
343
r.hi = _cl_sin(y0.hi);
344
pocl_static_assert(sizeof(pair_double8) == sizeof(double16));
345
return bitcast<pair_double8,double16>(r);
349
#endif // #ifdef cl_khr_fp64