llvm-project/libclc/generic/lib/math/native_powr.inc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

6 lines
217 B
PHP
Raw Normal View History

_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_powr(__CLC_GENTYPE x, __CLC_GENTYPE y) {
// x^y == 2^{log2 x^y} == 2^{y * log2 x}
// for x < 0 propagate nan created by log2
return native_exp2(y * native_log2(x));
}