1
// Note: This file has been automatically generated. Do not modify.
3
#include "pocl-compat.h"
5
// remainder: ['VF', 'VF'] -> VF
8
#if defined VECMATHLIB_HAVE_VEC_FLOAT_1
9
// Implement remainder by calling vecmathlib
10
float _cl_remainder(float x0, float x1)
12
vecmathlib::realvec<float,1> y0 = bitcast<float,vecmathlib::realvec<float,1> >(x0);
13
vecmathlib::realvec<float,1> y1 = bitcast<float,vecmathlib::realvec<float,1> >(x1);
14
vecmathlib::realvec<float,1> r = vecmathlib::remainder(y0, y1);
15
return bitcast<vecmathlib::realvec<float,1>,float>((r));
18
// Implement remainder by calling libm
19
float _cl_remainder(float x0, float x1)
21
vecmathlib::realpseudovec<float,1> y0 = x0;
22
vecmathlib::realpseudovec<float,1> y1 = x1;
23
vecmathlib::realpseudovec<float,1> r = remainder(y0, y1);
28
// remainder: VF=float2
29
#if defined VECMATHLIB_HAVE_VEC_FLOAT_2
30
// Implement remainder by calling vecmathlib
31
float2 _cl_remainder(float2 x0, float2 x1)
33
vecmathlib::realvec<float,2> y0 = bitcast<float2,vecmathlib::realvec<float,2> >(x0);
34
vecmathlib::realvec<float,2> y1 = bitcast<float2,vecmathlib::realvec<float,2> >(x1);
35
vecmathlib::realvec<float,2> r = vecmathlib::remainder(y0, y1);
36
return bitcast<vecmathlib::realvec<float,2>,float2>((r));
38
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
39
// Implement remainder by using a larger vector size
40
float4 _cl_remainder(float4, float4);
41
float2 _cl_remainder(float2 x0, float2 x1)
43
float4 y0 = bitcast<float2,float4>(x0);
44
float4 y1 = bitcast<float2,float4>(x1);
45
float4 r = _cl_remainder(y0, y1);
46
return bitcast<float4,float2>(r);
49
// Implement remainder by splitting into a smaller vector size
50
float _cl_remainder(float, float);
51
float2 _cl_remainder(float2 x0, float2 x1)
53
pair_float y0 = bitcast<float2,pair_float>(x0);
54
pair_float y1 = bitcast<float2,pair_float>(x1);
56
r.lo = _cl_remainder(y0.lo, y1.lo);
57
r.hi = _cl_remainder(y0.hi, y1.hi);
58
pocl_static_assert(sizeof(pair_float) == sizeof(float2));
59
return bitcast<pair_float,float2>(r);
63
// remainder: VF=float3
64
#if defined VECMATHLIB_HAVE_VEC_FLOAT_3
65
// Implement remainder by calling vecmathlib
66
float3 _cl_remainder(float3 x0, float3 x1)
68
vecmathlib::realvec<float,3> y0 = bitcast<float3,vecmathlib::realvec<float,3> >(x0);
69
vecmathlib::realvec<float,3> y1 = bitcast<float3,vecmathlib::realvec<float,3> >(x1);
70
vecmathlib::realvec<float,3> r = vecmathlib::remainder(y0, y1);
71
return bitcast<vecmathlib::realvec<float,3>,float3>((r));
73
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_4 || defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
74
// Implement remainder by using a larger vector size
75
float4 _cl_remainder(float4, float4);
76
float3 _cl_remainder(float3 x0, float3 x1)
78
float4 y0 = bitcast<float3,float4>(x0);
79
float4 y1 = bitcast<float3,float4>(x1);
80
float4 r = _cl_remainder(y0, y1);
81
return bitcast<float4,float3>(r);
84
// Implement remainder by splitting into a smaller vector size
85
float2 _cl_remainder(float2, float2);
86
float3 _cl_remainder(float3 x0, float3 x1)
88
pair_float2 y0 = bitcast<float3,pair_float2>(x0);
89
pair_float2 y1 = bitcast<float3,pair_float2>(x1);
91
r.lo = _cl_remainder(y0.lo, y1.lo);
92
r.hi = _cl_remainder(y0.hi, y1.hi);
93
pocl_static_assert(sizeof(pair_float2) == sizeof(float3));
94
return bitcast<pair_float2,float3>(r);
98
// remainder: VF=float4
99
#if defined VECMATHLIB_HAVE_VEC_FLOAT_4
100
// Implement remainder by calling vecmathlib
101
float4 _cl_remainder(float4 x0, float4 x1)
103
vecmathlib::realvec<float,4> y0 = bitcast<float4,vecmathlib::realvec<float,4> >(x0);
104
vecmathlib::realvec<float,4> y1 = bitcast<float4,vecmathlib::realvec<float,4> >(x1);
105
vecmathlib::realvec<float,4> r = vecmathlib::remainder(y0, y1);
106
return bitcast<vecmathlib::realvec<float,4>,float4>((r));
108
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_8 || defined VECMATHLIB_HAVE_VEC_FLOAT_16
109
// Implement remainder by using a larger vector size
110
float8 _cl_remainder(float8, float8);
111
float4 _cl_remainder(float4 x0, float4 x1)
113
float8 y0 = bitcast<float4,float8>(x0);
114
float8 y1 = bitcast<float4,float8>(x1);
115
float8 r = _cl_remainder(y0, y1);
116
return bitcast<float8,float4>(r);
119
// Implement remainder by splitting into a smaller vector size
120
float2 _cl_remainder(float2, float2);
121
float4 _cl_remainder(float4 x0, float4 x1)
123
pair_float2 y0 = bitcast<float4,pair_float2>(x0);
124
pair_float2 y1 = bitcast<float4,pair_float2>(x1);
126
r.lo = _cl_remainder(y0.lo, y1.lo);
127
r.hi = _cl_remainder(y0.hi, y1.hi);
128
pocl_static_assert(sizeof(pair_float2) == sizeof(float4));
129
return bitcast<pair_float2,float4>(r);
133
// remainder: VF=float8
134
#if defined VECMATHLIB_HAVE_VEC_FLOAT_8
135
// Implement remainder by calling vecmathlib
136
float8 _cl_remainder(float8 x0, float8 x1)
138
vecmathlib::realvec<float,8> y0 = bitcast<float8,vecmathlib::realvec<float,8> >(x0);
139
vecmathlib::realvec<float,8> y1 = bitcast<float8,vecmathlib::realvec<float,8> >(x1);
140
vecmathlib::realvec<float,8> r = vecmathlib::remainder(y0, y1);
141
return bitcast<vecmathlib::realvec<float,8>,float8>((r));
143
#elif defined VECMATHLIB_HAVE_VEC_FLOAT_16
144
// Implement remainder by using a larger vector size
145
float16 _cl_remainder(float16, float16);
146
float8 _cl_remainder(float8 x0, float8 x1)
148
float16 y0 = bitcast<float8,float16>(x0);
149
float16 y1 = bitcast<float8,float16>(x1);
150
float16 r = _cl_remainder(y0, y1);
151
return bitcast<float16,float8>(r);
154
// Implement remainder by splitting into a smaller vector size
155
float4 _cl_remainder(float4, float4);
156
float8 _cl_remainder(float8 x0, float8 x1)
158
pair_float4 y0 = bitcast<float8,pair_float4>(x0);
159
pair_float4 y1 = bitcast<float8,pair_float4>(x1);
161
r.lo = _cl_remainder(y0.lo, y1.lo);
162
r.hi = _cl_remainder(y0.hi, y1.hi);
163
pocl_static_assert(sizeof(pair_float4) == sizeof(float8));
164
return bitcast<pair_float4,float8>(r);
168
// remainder: VF=float16
169
#if defined VECMATHLIB_HAVE_VEC_FLOAT_16
170
// Implement remainder by calling vecmathlib
171
float16 _cl_remainder(float16 x0, float16 x1)
173
vecmathlib::realvec<float,16> y0 = bitcast<float16,vecmathlib::realvec<float,16> >(x0);
174
vecmathlib::realvec<float,16> y1 = bitcast<float16,vecmathlib::realvec<float,16> >(x1);
175
vecmathlib::realvec<float,16> r = vecmathlib::remainder(y0, y1);
176
return bitcast<vecmathlib::realvec<float,16>,float16>((r));
179
// Implement remainder by splitting into a smaller vector size
180
float8 _cl_remainder(float8, float8);
181
float16 _cl_remainder(float16 x0, float16 x1)
183
pair_float8 y0 = bitcast<float16,pair_float8>(x0);
184
pair_float8 y1 = bitcast<float16,pair_float8>(x1);
186
r.lo = _cl_remainder(y0.lo, y1.lo);
187
r.hi = _cl_remainder(y0.hi, y1.hi);
188
pocl_static_assert(sizeof(pair_float8) == sizeof(float16));
189
return bitcast<pair_float8,float16>(r);
195
// remainder: VF=double
196
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_1
197
// Implement remainder by calling vecmathlib
198
double _cl_remainder(double x0, double x1)
200
vecmathlib::realvec<double,1> y0 = bitcast<double,vecmathlib::realvec<double,1> >(x0);
201
vecmathlib::realvec<double,1> y1 = bitcast<double,vecmathlib::realvec<double,1> >(x1);
202
vecmathlib::realvec<double,1> r = vecmathlib::remainder(y0, y1);
203
return bitcast<vecmathlib::realvec<double,1>,double>((r));
206
// Implement remainder by calling libm
207
double _cl_remainder(double x0, double x1)
209
vecmathlib::realpseudovec<double,1> y0 = x0;
210
vecmathlib::realpseudovec<double,1> y1 = x1;
211
vecmathlib::realpseudovec<double,1> r = remainder(y0, y1);
216
// remainder: VF=double2
217
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_2
218
// Implement remainder by calling vecmathlib
219
double2 _cl_remainder(double2 x0, double2 x1)
221
vecmathlib::realvec<double,2> y0 = bitcast<double2,vecmathlib::realvec<double,2> >(x0);
222
vecmathlib::realvec<double,2> y1 = bitcast<double2,vecmathlib::realvec<double,2> >(x1);
223
vecmathlib::realvec<double,2> r = vecmathlib::remainder(y0, y1);
224
return bitcast<vecmathlib::realvec<double,2>,double2>((r));
226
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
227
// Implement remainder by using a larger vector size
228
double4 _cl_remainder(double4, double4);
229
double2 _cl_remainder(double2 x0, double2 x1)
231
double4 y0 = bitcast<double2,double4>(x0);
232
double4 y1 = bitcast<double2,double4>(x1);
233
double4 r = _cl_remainder(y0, y1);
234
return bitcast<double4,double2>(r);
237
// Implement remainder by splitting into a smaller vector size
238
double _cl_remainder(double, double);
239
double2 _cl_remainder(double2 x0, double2 x1)
241
pair_double y0 = bitcast<double2,pair_double>(x0);
242
pair_double y1 = bitcast<double2,pair_double>(x1);
244
r.lo = _cl_remainder(y0.lo, y1.lo);
245
r.hi = _cl_remainder(y0.hi, y1.hi);
246
pocl_static_assert(sizeof(pair_double) == sizeof(double2));
247
return bitcast<pair_double,double2>(r);
251
// remainder: VF=double3
252
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_3
253
// Implement remainder by calling vecmathlib
254
double3 _cl_remainder(double3 x0, double3 x1)
256
vecmathlib::realvec<double,3> y0 = bitcast<double3,vecmathlib::realvec<double,3> >(x0);
257
vecmathlib::realvec<double,3> y1 = bitcast<double3,vecmathlib::realvec<double,3> >(x1);
258
vecmathlib::realvec<double,3> r = vecmathlib::remainder(y0, y1);
259
return bitcast<vecmathlib::realvec<double,3>,double3>((r));
261
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_4 || defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
262
// Implement remainder by using a larger vector size
263
double4 _cl_remainder(double4, double4);
264
double3 _cl_remainder(double3 x0, double3 x1)
266
double4 y0 = bitcast<double3,double4>(x0);
267
double4 y1 = bitcast<double3,double4>(x1);
268
double4 r = _cl_remainder(y0, y1);
269
return bitcast<double4,double3>(r);
272
// Implement remainder by splitting into a smaller vector size
273
double2 _cl_remainder(double2, double2);
274
double3 _cl_remainder(double3 x0, double3 x1)
276
pair_double2 y0 = bitcast<double3,pair_double2>(x0);
277
pair_double2 y1 = bitcast<double3,pair_double2>(x1);
279
r.lo = _cl_remainder(y0.lo, y1.lo);
280
r.hi = _cl_remainder(y0.hi, y1.hi);
281
pocl_static_assert(sizeof(pair_double2) == sizeof(double3));
282
return bitcast<pair_double2,double3>(r);
286
// remainder: VF=double4
287
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_4
288
// Implement remainder by calling vecmathlib
289
double4 _cl_remainder(double4 x0, double4 x1)
291
vecmathlib::realvec<double,4> y0 = bitcast<double4,vecmathlib::realvec<double,4> >(x0);
292
vecmathlib::realvec<double,4> y1 = bitcast<double4,vecmathlib::realvec<double,4> >(x1);
293
vecmathlib::realvec<double,4> r = vecmathlib::remainder(y0, y1);
294
return bitcast<vecmathlib::realvec<double,4>,double4>((r));
296
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_8 || defined VECMATHLIB_HAVE_VEC_DOUBLE_16
297
// Implement remainder by using a larger vector size
298
double8 _cl_remainder(double8, double8);
299
double4 _cl_remainder(double4 x0, double4 x1)
301
double8 y0 = bitcast<double4,double8>(x0);
302
double8 y1 = bitcast<double4,double8>(x1);
303
double8 r = _cl_remainder(y0, y1);
304
return bitcast<double8,double4>(r);
307
// Implement remainder by splitting into a smaller vector size
308
double2 _cl_remainder(double2, double2);
309
double4 _cl_remainder(double4 x0, double4 x1)
311
pair_double2 y0 = bitcast<double4,pair_double2>(x0);
312
pair_double2 y1 = bitcast<double4,pair_double2>(x1);
314
r.lo = _cl_remainder(y0.lo, y1.lo);
315
r.hi = _cl_remainder(y0.hi, y1.hi);
316
pocl_static_assert(sizeof(pair_double2) == sizeof(double4));
317
return bitcast<pair_double2,double4>(r);
321
// remainder: VF=double8
322
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_8
323
// Implement remainder by calling vecmathlib
324
double8 _cl_remainder(double8 x0, double8 x1)
326
vecmathlib::realvec<double,8> y0 = bitcast<double8,vecmathlib::realvec<double,8> >(x0);
327
vecmathlib::realvec<double,8> y1 = bitcast<double8,vecmathlib::realvec<double,8> >(x1);
328
vecmathlib::realvec<double,8> r = vecmathlib::remainder(y0, y1);
329
return bitcast<vecmathlib::realvec<double,8>,double8>((r));
331
#elif defined VECMATHLIB_HAVE_VEC_DOUBLE_16
332
// Implement remainder by using a larger vector size
333
double16 _cl_remainder(double16, double16);
334
double8 _cl_remainder(double8 x0, double8 x1)
336
double16 y0 = bitcast<double8,double16>(x0);
337
double16 y1 = bitcast<double8,double16>(x1);
338
double16 r = _cl_remainder(y0, y1);
339
return bitcast<double16,double8>(r);
342
// Implement remainder by splitting into a smaller vector size
343
double4 _cl_remainder(double4, double4);
344
double8 _cl_remainder(double8 x0, double8 x1)
346
pair_double4 y0 = bitcast<double8,pair_double4>(x0);
347
pair_double4 y1 = bitcast<double8,pair_double4>(x1);
349
r.lo = _cl_remainder(y0.lo, y1.lo);
350
r.hi = _cl_remainder(y0.hi, y1.hi);
351
pocl_static_assert(sizeof(pair_double4) == sizeof(double8));
352
return bitcast<pair_double4,double8>(r);
356
// remainder: VF=double16
357
#if defined VECMATHLIB_HAVE_VEC_DOUBLE_16
358
// Implement remainder by calling vecmathlib
359
double16 _cl_remainder(double16 x0, double16 x1)
361
vecmathlib::realvec<double,16> y0 = bitcast<double16,vecmathlib::realvec<double,16> >(x0);
362
vecmathlib::realvec<double,16> y1 = bitcast<double16,vecmathlib::realvec<double,16> >(x1);
363
vecmathlib::realvec<double,16> r = vecmathlib::remainder(y0, y1);
364
return bitcast<vecmathlib::realvec<double,16>,double16>((r));
367
// Implement remainder by splitting into a smaller vector size
368
double8 _cl_remainder(double8, double8);
369
double16 _cl_remainder(double16 x0, double16 x1)
371
pair_double8 y0 = bitcast<double16,pair_double8>(x0);
372
pair_double8 y1 = bitcast<double16,pair_double8>(x1);
374
r.lo = _cl_remainder(y0.lo, y1.lo);
375
r.hi = _cl_remainder(y0.hi, y1.hi);
376
pocl_static_assert(sizeof(pair_double8) == sizeof(double16));
377
return bitcast<pair_double8,double16>(r);
381
#endif // #ifdef cl_khr_fp64