[libc++][Android] BuildKite CI: update Clang and sysroot versions (#116151)
[llvm-project.git] / libclc / r600 / lib / math / fmin.cl
bloba43655da13845120f0efe834dcc77da12a1887ac
1 #include <clc/clc.h>
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)
17 #ifdef cl_khr_fp64
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)
27 #endif
29 #define __CLC_BODY <../../../generic/lib/math/fmin.inc>
30 #include <clc/math/gentype.inc>