Sign in
llvm
/
llvm-project
/
311dd55c9eb9342b1c889f6db7728f15b05378bb
/
.
/
libclc
/
generic
/
lib
/
math
/
native_powr.inc
blob: f2c30a9cb5e1c262edcc6b8ca7cd2d123bd45706 [
file
] [
log
] [
blame
]
_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
));
}