[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / libclc / r600 / lib / math / fmin.cl
blob09f1e4c7faad38e6e419cb65bb950711ad57a41e
1 #include <clc/clc.h>
3 #include "../../../generic/lib/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>