diff options
author | Stephen Hines <srhines@google.com> | 2013-01-16 18:46:43 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2013-01-16 18:46:43 -0800 |
commit | 891bcfe43dd32783ee76ccf1a1f0669a95a4aa1b (patch) | |
tree | ab9caac954edcb909c927f35729a079e1e43abef /scriptc | |
parent | c0baffe7c9020f32b948dd46789590cf5dc3b988 (diff) | |
download | rs-891bcfe43dd32783ee76ccf1a1f0669a95a4aa1b.tar.gz |
Construct fract(float) as a static inline call, instead of a new function.
Change-Id: I1356662cccc3d751e5dbe66353d4ce0956c9867c
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 211f53ba..1bcf1c93 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] |