diff options
author | Stephen Hines <srhines@google.com> | 2013-01-18 23:35:10 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-01-18 23:35:10 +0000 |
commit | 87212a210bea79b2dc29be86b78378ce5d170b6f (patch) | |
tree | 22e46103e2d98f479b73f4d63a7a16278c0f8198 /scriptc | |
parent | db1499c8cb5ac566efa94c105e669edfcb8d3e8c (diff) | |
parent | 891bcfe43dd32783ee76ccf1a1f0669a95a4aa1b (diff) | |
download | rs-87212a210bea79b2dc29be86b78378ce5d170b6f.tar.gz |
Merge "Construct fract(float) as a static inline call, instead of a new function."
Diffstat (limited to 'scriptc')
-rw-r--r-- | scriptc/rs_cl.rsh | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/scriptc/rs_cl.rsh b/scriptc/rs_cl.rsh index 6a84405f..774e5d2f 100644 --- a/scriptc/rs_cl.rsh +++ b/scriptc/rs_cl.rsh @@ -450,19 +450,36 @@ FN_FUNC_FN_FN(fmod) /** * Return fractional part of v * + * @param iptr iptr[0] will be set to the floor of the input value. * Supports float, float2, float3, float4. */ -_RS_RUNTIME float __attribute__((overloadable)) fract(float v); -FN_FUNC_FN(fract) +_RS_RUNTIME float __attribute__((overloadable)) fract(float v, float *iptr); +FN_FUNC_FN_PFN(fract) /** * Return fractional part of v * - * @param iptr iptr[0] will be set to the floor of the input value. * Supports float, float2, float3, float4. */ -_RS_RUNTIME float __attribute__((overloadable)) fract(float v, float *iptr); -FN_FUNC_FN_PFN(fract) +static inline float __attribute__((overloadable)) fract(float v) { + float unused; + return fract(v, &unused); +} + +static inline float2 __attribute__((overloadable)) fract(float2 v) { + float2 unused; + return fract(v, &unused); +} + +static inline float3 __attribute__((overloadable)) fract(float3 v) { + float3 unused; + return fract(v, &unused); +} + +static inline float4 __attribute__((overloadable)) fract(float4 v) { + float4 unused; + return fract(v, &unused); +} /** * Return the mantissa and place the exponent into iptr[0] |