2 #include
<clc
/clcmacro.h
>
4 #include
"../../../generic/lib/math/math.h"
6 _CLC_DEF _CLC_OVERLOAD float fmin
(float x
, float y
)
8 /* fcanonicalize removes sNaNs and flushes denormals if not enabled.
9 * Otherwise fmin instruction flushes the values for comparison
,
10 * but outputs original denormal
*/
11 x
= __clc_flush_denormal_if_not_supported
(x);
12 y
= __clc_flush_denormal_if_not_supported
(y);
13 return __builtin_fminf
(x, y
);
15 _CLC_BINARY_VECTORIZE
(_CLC_OVERLOAD _CLC_DEF
, float
, fmin
, float
, float
)
19 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
21 _CLC_DEF _CLC_OVERLOAD double fmin
(double x
, double y
)
23 return __builtin_fmin
(x, y
);
25 _CLC_BINARY_VECTORIZE
(_CLC_OVERLOAD _CLC_DEF
, double
, fmin
, double
, double
)
29 #define __CLC_BODY
<..
/..
/..
/generic
/lib
/math
/fmin.inc
>
30 #include
<clc
/math
/gentype.inc
>