[SampleProfileLoader] Fix integer overflow in generateMDProfMetadata (#90217)
[llvm-project.git] / libclc / generic / lib / math / fmin.cl
blob45c112d991ff928f0bc3f4772003f45a21b86d2e
1 #include <clc/clc.h>
3 #include "../clcmacro.h"
5 _CLC_DEFINE_BINARY_BUILTIN(float, fmin, __builtin_fminf, float, float);
7 #ifdef cl_khr_fp64
9 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
11 _CLC_DEFINE_BINARY_BUILTIN(double, fmin, __builtin_fmin, double, double);
13 #endif
14 #ifdef cl_khr_fp16
16 #pragma OPENCL EXTENSION cl_khr_fp16 : enable
18 _CLC_DEF _CLC_OVERLOAD half fmin(half x, half y)
20 if (isnan(x))
21 return y;
22 if (isnan(y))
23 return x;
24 return (y < x) ? y : x;
26 _CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, half, fmin, half, half)
28 #endif
30 #define __CLC_BODY <fmin.inc>
31 #include <clc/math/gentype.inc>