[X86] Better handling of impossibly large stack frames (#124217)
[llvm-project.git] / libclc / generic / lib / math / log.cl
blob336c8016a6ed8aa5adddb3102bb170d9165db9d4
1 #include <clc/clc.h>
2 #include <clc/clcmacro.h>
4 /*
5 *log(x) = log2(x) * (1/log2(e))
6 */
8 _CLC_OVERLOAD _CLC_DEF float log(float x)
10 return log2(x) * (1.0f / M_LOG2E_F);
13 _CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, log, float);
15 #ifdef cl_khr_fp64
17 #pragma OPENCL EXTENSION cl_khr_fp64 : enable
19 _CLC_OVERLOAD _CLC_DEF double log(double x)
21 return log2(x) * (1.0 / M_LOG2E);
24 _CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, log, double);
26 #endif // cl_khr_fp64