[clang-tidy][use-internal-linkage] fix false positive for consteval function (#122141)
[llvm-project.git] / libclc / generic / lib / math / native_powr.inc
blobf2c30a9cb5e1c262edcc6b8ca7cd2d123bd45706
1 _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_powr(__CLC_GENTYPE x, __CLC_GENTYPE y) {
2   // x^y == 2^{log2 x^y} == 2^{y * log2 x}
3   // for x < 0 propagate nan created by log2
4   return native_exp2(y * native_log2(x));