[X86] Better handling of impossibly large stack frames (#124217)
[llvm-project.git] / libclc / generic / lib / math / fmin.cl
blob55575d0486b60af94c35c7b7e15afbbcb188244c
1 #include <clc/clc.h>
2 #include <clc/clcmacro.h>
4 _CLC_DEFINE_BINARY_BUILTIN(float, fmin, __builtin_fminf, float, float);
6 #ifdef cl_khr_fp64
8 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
10 _CLC_DEFINE_BINARY_BUILTIN(double, fmin, __builtin_fmin, double, double);
12 #endif
13 #ifdef cl_khr_fp16
15 #pragma OPENCL EXTENSION cl_khr_fp16 : enable
17 _CLC_DEF _CLC_OVERLOAD half fmin(half x, half y)
19 if (isnan(x))
20 return y;
21 if (isnan(y))
22 return x;
23 return (y < x) ? y : x;
25 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, fmin, half, half)
27 #endif
29 #define __CLC_BODY <fmin.inc>
30 #include <clc/math/gentype.inc>