2 #include
<clc
/clcmacro.h
>
4 _CLC_DEF _CLC_OVERLOAD float fmin
(float x
, float y
)
6 /* fcanonicalize removes sNaNs and flushes denormals if not enabled.
7 * Otherwise fmin instruction flushes the values for comparison
,
8 * but outputs original denormal
*/
9 x
= __builtin_canonicalizef
(x);
10 y
= __builtin_canonicalizef
(y);
11 return __builtin_fminf
(x, y
);
13 _CLC_BINARY_VECTORIZE
(_CLC_OVERLOAD _CLC_DEF
, float
, fmin
, float
, float
)
17 #pragma OPENCL EXTENSION cl_khr_fp64
: enable
19 _CLC_DEF _CLC_OVERLOAD double fmin
(double x
, double y
)
21 x
= __builtin_canonicalize
(x);
22 y
= __builtin_canonicalize
(y);
23 return __builtin_fmin
(x, y
);
25 _CLC_BINARY_VECTORIZE
(_CLC_OVERLOAD _CLC_DEF
, double
, fmin
, double
, double
)
30 #pragma OPENCL EXTENSION cl_khr_fp16
: enable
32 _CLC_DEF _CLC_OVERLOAD half fmin
(half x
, half y
)
38 return
(y < x
) ? y
: x
;
40 _CLC_BINARY_VECTORIZE
(_CLC_OVERLOAD _CLC_DEF
, half
, fmin
, half
, half
)
44 #define __CLC_BODY
<..
/..
/..
/generic
/lib
/math
/fmin.inc
>
45 #include
<clc
/math
/gentype.inc
>