diff options
author | Jason Sams <jsams@google.com> | 2013-01-18 14:10:32 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-01-18 14:11:32 -0800 |
commit | 59531f77bc1455f6b4ec394d08f836283df31b1e (patch) | |
tree | 27cd1ce403c1712f1c793c32847ad14e3cf998d9 /scriptc | |
parent | ad89698f3d9144bd825268ceb4793b5d2fda2492 (diff) | |
download | rs-59531f77bc1455f6b4ec394d08f836283df31b1e.tar.gz |
Implement fast native_exp*
Change-Id: I9b5b75e29fbe32c7b31775b03a53c4ecbc6bf4e2
Diffstat (limited to 'scriptc')
-rw-r--r-- | scriptc/rs_cl.rsh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scriptc/rs_cl.rsh b/scriptc/rs_cl.rsh index 211f53ba..6a84405f 100644 --- a/scriptc/rs_cl.rsh +++ b/scriptc/rs_cl.rsh @@ -967,6 +967,45 @@ F_FUNC_FN(fast_normalize) #endif // (defined(RS_VERSION) && (RS_VERSION >= 17)) + +#if (defined(RS_VERSION) && (RS_VERSION >= 18)) +// Fast native math functions. + + +/** + * Fast approximate exp2 + * valid for inputs -125.f to 125.f + * Max 8192 ulps of error + * + * Supports 1,2,3,4 components + */ +_RS_RUNTIME float __attribute__((overloadable)) native_exp2(float v); +FN_FUNC_FN(native_exp2) + +/** + * Fast approximate exp + * valid for inputs -86.f to 86.f + * Max 8192 ulps of error + * + * Supports 1,2,3,4 components + */ +_RS_RUNTIME float __attribute__((overloadable)) native_exp(float v); +FN_FUNC_FN(native_exp) + +/** + * Fast approximate exp10 + * valid for inputs -37.f to 37.f + * Max 8192 ulps of error + * + * Supports 1,2,3,4 components + */ +_RS_RUNTIME float __attribute__((overloadable)) native_exp10(float v); +FN_FUNC_FN(native_exp10) + + +#endif // (defined(RS_VERSION) && (RS_VERSION >= 18)) + + #undef CVT_FUNC #undef CVT_FUNC_2 #undef FN_FUNC_FN |