diff options
author | Jason Sams <rjsams@android.com> | 2010-03-16 15:41:08 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-16 15:41:08 -0700 |
commit | 41e6ce1e41491ecb5d09ee9224fa661ef8f4b262 (patch) | |
tree | b06b2266f8b7b6e7c70f258e1e9fa5e2312dae80 /libs | |
parent | 4ab72cb7e79c15b94b4b7aca4cdb28677a615f8a (diff) | |
parent | 33bcfa210abe67ab4829ebc03f15ea87be626d6d (diff) | |
download | frameworks_base-41e6ce1e41491ecb5d09ee9224fa661ef8f4b262.zip frameworks_base-41e6ce1e41491ecb5d09ee9224fa661ef8f4b262.tar.gz frameworks_base-41e6ce1e41491ecb5d09ee9224fa661ef8f4b262.tar.bz2 |
Merge "First cut of basic RS headers for ScriptC. Not nearly complete."
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/scriptc/rs_math.rsh | 287 | ||||
-rw-r--r-- | libs/rs/scriptc/rs_types.rsh | 71 |
2 files changed, 358 insertions, 0 deletions
diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh new file mode 100644 index 0000000..613c7ca --- /dev/null +++ b/libs/rs/scriptc/rs_math.rsh @@ -0,0 +1,287 @@ +// Float ops + +extern float __attribute__((overloadable)) abs(float); +extern float2 __attribute__((overloadable)) abs(float2); +extern float3 __attribute__((overloadable)) abs(float3); +extern float4 __attribute__((overloadable)) abs(float4); +extern float8 __attribute__((overloadable)) abs(float8); +extern float16 __attribute__((overloadable)) abs(float16); + +extern float __attribute__((overloadable)) acos(float); +extern float2 __attribute__((overloadable)) acos(float2); +extern float3 __attribute__((overloadable)) acos(float3); +extern float4 __attribute__((overloadable)) acos(float4); +extern float8 __attribute__((overloadable)) acos(float8); +extern float16 __attribute__((overloadable)) acos(float16); + +extern float __attribute__((overloadable)) asin(float); +extern float2 __attribute__((overloadable)) asin(float2); +extern float3 __attribute__((overloadable)) asin(float3); +extern float4 __attribute__((overloadable)) asin(float4); +extern float8 __attribute__((overloadable)) asin(float8); +extern float16 __attribute__((overloadable)) asin(float16); + +extern float __attribute__((overloadable)) atan(float); +extern float2 __attribute__((overloadable)) atan(float2); +extern float3 __attribute__((overloadable)) atan(float3); +extern float4 __attribute__((overloadable)) atan(float4); +extern float8 __attribute__((overloadable)) atan(float8); +extern float16 __attribute__((overloadable)) atan(float16); + +extern float __attribute__((overloadable)) atan2(float, float); +extern float2 __attribute__((overloadable)) atan2(float2, float2); +extern float3 __attribute__((overloadable)) atan2(float3, float3); +extern float4 __attribute__((overloadable)) atan2(float4, float4); +extern float8 __attribute__((overloadable)) atan2(float8, float8); +extern float16 __attribute__((overloadable)) atan2(float16, float16); + +extern float __attribute__((overloadable)) ceil(float); +extern float2 __attribute__((overloadable)) ceil(float2); +extern float3 __attribute__((overloadable)) ceil(float3); +extern float4 __attribute__((overloadable)) ceil(float4); +extern float8 __attribute__((overloadable)) ceil(float8); +extern float16 __attribute__((overloadable)) ceil(float16); + +extern float __attribute__((overloadable)) clamp(float, float, float); +extern float2 __attribute__((overloadable)) clamp(float2, float2, float2); +extern float3 __attribute__((overloadable)) clamp(float3, float3, float3); +extern float4 __attribute__((overloadable)) clamp(float4, float4, float4); +extern float8 __attribute__((overloadable)) clamp(float8, float8, float8); +extern float16 __attribute__((overloadable)) clamp(float16, float16, float16); +extern float __attribute__((overloadable)) clamp(float, float, float); +extern float2 __attribute__((overloadable)) clamp(float2, float, float); +extern float3 __attribute__((overloadable)) clamp(float3, float, float); +extern float4 __attribute__((overloadable)) clamp(float4, float, float); +extern float8 __attribute__((overloadable)) clamp(float8, float, float); +extern float16 __attribute__((overloadable)) clamp(float16, float, float); + +extern float __attribute__((overloadable)) copysign(float, float); +extern float2 __attribute__((overloadable)) copysign(float2, float2); +extern float3 __attribute__((overloadable)) copysign(float3, float3); +extern float4 __attribute__((overloadable)) copysign(float4, float4); +extern float8 __attribute__((overloadable)) copysign(float8, float8); +extern float16 __attribute__((overloadable)) copysign(float16, float16); + +extern float __attribute__((overloadable)) cos(float); +extern float2 __attribute__((overloadable)) cos(float2); +extern float3 __attribute__((overloadable)) cos(float3); +extern float4 __attribute__((overloadable)) cos(float4); +extern float8 __attribute__((overloadable)) cos(float8); +extern float16 __attribute__((overloadable)) cos(float16); + +extern float __attribute__((overloadable)) degrees(float); +extern float2 __attribute__((overloadable)) degrees(float2); +extern float3 __attribute__((overloadable)) degrees(float3); +extern float4 __attribute__((overloadable)) degrees(float4); +extern float8 __attribute__((overloadable)) degrees(float8); +extern float16 __attribute__((overloadable)) degrees(float16); + +extern float __attribute__((overloadable)) exp(float); +extern float2 __attribute__((overloadable)) exp(float2); +extern float3 __attribute__((overloadable)) exp(float3); +extern float4 __attribute__((overloadable)) exp(float4); +extern float8 __attribute__((overloadable)) exp(float8); +extern float16 __attribute__((overloadable)) exp(float16); + +extern float __attribute__((overloadable)) exp2(float); +extern float2 __attribute__((overloadable)) exp2(float2); +extern float3 __attribute__((overloadable)) exp2(float3); +extern float4 __attribute__((overloadable)) exp2(float4); +extern float8 __attribute__((overloadable)) exp2(float8); +extern float16 __attribute__((overloadable)) exp2(float16); + +extern float __attribute__((overloadable)) exp10(float); +extern float2 __attribute__((overloadable)) exp10(float2); +extern float3 __attribute__((overloadable)) exp10(float3); +extern float4 __attribute__((overloadable)) exp10(float4); +extern float8 __attribute__((overloadable)) exp10(float8); +extern float16 __attribute__((overloadable)) exp10(float16); + +extern float __attribute__((overloadable)) fabs(float); +extern float2 __attribute__((overloadable)) fabs(float2); +extern float3 __attribute__((overloadable)) fabs(float3); +extern float4 __attribute__((overloadable)) fabs(float4); +extern float8 __attribute__((overloadable)) fabs(float8); +extern float16 __attribute__((overloadable)) fabs(float16); + +extern float __attribute__((overloadable)) floor(float); +extern float2 __attribute__((overloadable)) floor(float2); +extern float3 __attribute__((overloadable)) floor(float3); +extern float4 __attribute__((overloadable)) floor(float4); +extern float8 __attribute__((overloadable)) floor(float8); +extern float16 __attribute__((overloadable)) floor(float16); + +extern float __attribute__((overloadable)) fmax(float, float); +extern float2 __attribute__((overloadable)) fmax(float2, float2); +extern float3 __attribute__((overloadable)) fmax(float3, float3); +extern float4 __attribute__((overloadable)) fmax(float4, float4); +extern float8 __attribute__((overloadable)) fmax(float8, float8); +extern float16 __attribute__((overloadable)) fmax(float16, float16); +extern float2 __attribute__((overloadable)) fmax(float2, float); +extern float3 __attribute__((overloadable)) fmax(float3, float); +extern float4 __attribute__((overloadable)) fmax(float4, float); +extern float8 __attribute__((overloadable)) fmax(float8, float); +extern float16 __attribute__((overloadable)) fmax(float16, float); + +extern float __attribute__((overloadable)) fmin(float, float); +extern float2 __attribute__((overloadable)) fmin(float2, float2); +extern float3 __attribute__((overloadable)) fmin(float3, float3); +extern float4 __attribute__((overloadable)) fmin(float4, float4); +extern float8 __attribute__((overloadable)) fmin(float8, float8); +extern float16 __attribute__((overloadable)) fmin(float16, float16); +extern float2 __attribute__((overloadable)) fmin(float2, float); +extern float3 __attribute__((overloadable)) fmin(float3, float); +extern float4 __attribute__((overloadable)) fmin(float4, float); +extern float8 __attribute__((overloadable)) fmin(float8, float); +extern float16 __attribute__((overloadable)) fmin(float16, float); + +extern float __attribute__((overloadable)) fmod(float, float); +extern float2 __attribute__((overloadable)) fmod(float2, float2); +extern float3 __attribute__((overloadable)) fmod(float3, float3); +extern float4 __attribute__((overloadable)) fmod(float4, float4); +extern float8 __attribute__((overloadable)) fmod(float8, float8); +extern float16 __attribute__((overloadable)) fmod(float16, float16); + +extern float __attribute__((overloadable)) log(float); +extern float2 __attribute__((overloadable)) log(float2); +extern float3 __attribute__((overloadable)) log(float3); +extern float4 __attribute__((overloadable)) log(float4); +extern float8 __attribute__((overloadable)) log(float8); +extern float16 __attribute__((overloadable)) log(float16); + +extern float __attribute__((overloadable)) log2(float); +extern float2 __attribute__((overloadable)) log2(float2); +extern float3 __attribute__((overloadable)) log2(float3); +extern float4 __attribute__((overloadable)) log2(float4); +extern float8 __attribute__((overloadable)) log2(float8); +extern float16 __attribute__((overloadable)) log2(float16); + +extern float __attribute__((overloadable)) log10(float); +extern float2 __attribute__((overloadable)) log10(float2); +extern float3 __attribute__((overloadable)) log10(float3); +extern float4 __attribute__((overloadable)) log10(float4); +extern float8 __attribute__((overloadable)) log10(float8); +extern float16 __attribute__((overloadable)) log10(float16); + +extern float __attribute__((overloadable)) max(float, float); +extern float2 __attribute__((overloadable)) max(float2, float2); +extern float3 __attribute__((overloadable)) max(float3, float3); +extern float4 __attribute__((overloadable)) max(float4, float4); +extern float8 __attribute__((overloadable)) max(float8, float8); +extern float16 __attribute__((overloadable)) max(float16, float16); + +extern float __attribute__((overloadable)) min(float, float); +extern float2 __attribute__((overloadable)) min(float2, float2); +extern float3 __attribute__((overloadable)) min(float3, float3); +extern float4 __attribute__((overloadable)) min(float4, float4); +extern float8 __attribute__((overloadable)) min(float8, float8); +extern float16 __attribute__((overloadable)) min(float16, float16); + +extern float __attribute__((overloadable)) mix(float, float, float); +extern float2 __attribute__((overloadable)) mix(float2, float2, float2); +extern float3 __attribute__((overloadable)) mix(float3, float3, float3); +extern float4 __attribute__((overloadable)) mix(float4, float4, float4); +extern float8 __attribute__((overloadable)) mix(float8, float8, float8); +extern float16 __attribute__((overloadable)) mix(float16, float16, float16); +extern float __attribute__((overloadable)) mix(float, float, float); +extern float2 __attribute__((overloadable)) mix(float2, float2, float); +extern float3 __attribute__((overloadable)) mix(float3, float3, float); +extern float4 __attribute__((overloadable)) mix(float4, float4, float); +extern float8 __attribute__((overloadable)) mix(float8, float8, float); +extern float16 __attribute__((overloadable)) mix(float16, float16, float); + +extern float __attribute__((overloadable)) pow(float, float); +extern float2 __attribute__((overloadable)) pow(float2, float2); +extern float3 __attribute__((overloadable)) pow(float3, float3); +extern float4 __attribute__((overloadable)) pow(float4, float4); +extern float8 __attribute__((overloadable)) pow(float8, float8); +extern float16 __attribute__((overloadable)) pow(float16, float16); + +extern float __attribute__((overloadable)) radians(float); +extern float2 __attribute__((overloadable)) radians(float2); +extern float3 __attribute__((overloadable)) radians(float3); +extern float4 __attribute__((overloadable)) radians(float4); +extern float8 __attribute__((overloadable)) radians(float8); +extern float16 __attribute__((overloadable)) radians(float16); + +extern float __attribute__((overloadable)) rint(float); +extern float2 __attribute__((overloadable)) rint(float2); +extern float3 __attribute__((overloadable)) rint(float3); +extern float4 __attribute__((overloadable)) rint(float4); +extern float8 __attribute__((overloadable)) rint(float8); +extern float16 __attribute__((overloadable)) rint(float16); + +extern float __attribute__((overloadable)) round(float); +extern float2 __attribute__((overloadable)) round(float2); +extern float3 __attribute__((overloadable)) round(float3); +extern float4 __attribute__((overloadable)) round(float4); +extern float8 __attribute__((overloadable)) round(float8); +extern float16 __attribute__((overloadable)) round(float16); + +extern float __attribute__((overloadable)) rsqrt(float); +extern float2 __attribute__((overloadable)) rsqrt(float2); +extern float3 __attribute__((overloadable)) rsqrt(float3); +extern float4 __attribute__((overloadable)) rsqrt(float4); +extern float8 __attribute__((overloadable)) rsqrt(float8); +extern float16 __attribute__((overloadable)) rsqrt(float16); + +extern float __attribute__((overloadable)) sign(float); +extern float2 __attribute__((overloadable)) sign(float2); +extern float3 __attribute__((overloadable)) sign(float3); +extern float4 __attribute__((overloadable)) sign(float4); +extern float8 __attribute__((overloadable)) sign(float8); +extern float16 __attribute__((overloadable)) sign(float16); + +extern float __attribute__((overloadable)) sin(float); +extern float2 __attribute__((overloadable)) sin(float2); +extern float3 __attribute__((overloadable)) sin(float3); +extern float4 __attribute__((overloadable)) sin(float4); +extern float8 __attribute__((overloadable)) sin(float8); +extern float16 __attribute__((overloadable)) sin(float16); + +extern float __attribute__((overloadable)) sqrt(float); +extern float2 __attribute__((overloadable)) sqrt(float2); +extern float3 __attribute__((overloadable)) sqrt(float3); +extern float4 __attribute__((overloadable)) sqrt(float4); +extern float8 __attribute__((overloadable)) sqrt(float8); +extern float16 __attribute__((overloadable)) sqrt(float16); + +extern float __attribute__((overloadable)) tan(float); +extern float2 __attribute__((overloadable)) tan(float2); +extern float3 __attribute__((overloadable)) tan(float3); +extern float4 __attribute__((overloadable)) tan(float4); +extern float8 __attribute__((overloadable)) tan(float8); +extern float16 __attribute__((overloadable)) tan(float16); + +extern float __attribute__((overloadable)) trunc(float); +extern float2 __attribute__((overloadable)) trunc(float2); +extern float3 __attribute__((overloadable)) trunc(float3); +extern float4 __attribute__((overloadable)) trunc(float4); +extern float8 __attribute__((overloadable)) trunc(float8); +extern float16 __attribute__((overloadable)) trunc(float16); + + + + + + +// Int ops + +extern int __attribute__((overloadable)) abs(int); +extern int2 __attribute__((overloadable)) abs(int2); +extern int3 __attribute__((overloadable)) abs(int3); +extern int4 __attribute__((overloadable)) abs(int4); +extern int8 __attribute__((overloadable)) abs(int8); +extern int16 __attribute__((overloadable)) abs(int16); + + + +/* +extern float modf(float, float); +extern float randf(float); +extern float randf2(float, float); +extern float fracf(float); +extern float lerpf(float, float, float); +extern float mapf(float, float, float, float, float); +*/ + diff --git a/libs/rs/scriptc/rs_types.rsh b/libs/rs/scriptc/rs_types.rsh new file mode 100644 index 0000000..ae1acdb --- /dev/null +++ b/libs/rs/scriptc/rs_types.rsh @@ -0,0 +1,71 @@ + +typedef char int8_t; +typedef short int16_t; +typedef int int32_t; +//typedef long int64_t; + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +//typedef long uint64_t; + +typedef uint8_t uchar; +typedef uint16_t ushort; +typedef uint32_t uint; +//typedef uint64_t ulong; + +typedef void * rs_element; +typedef void * rs_type; +typedef void * rs_allocation; +typedef void * rs_sampler; +typedef void * rs_script; +typedef void * rs_mesh; +typedef void * rs_program_fragment; +typedef void * rs_program_vertex; +typedef void * rs_program_raster; +typedef void * rs_program_store; + +typedef float float2 __attribute__((ext_vector_type(2))); +typedef float float3 __attribute__((ext_vector_type(3))); +typedef float float4 __attribute__((ext_vector_type(4))); +typedef float float8 __attribute__((ext_vector_type(8))); +typedef float float16 __attribute__((ext_vector_type(16))); + +typedef uchar uchar2 __attribute__((ext_vector_type(2))); +typedef uchar uchar3 __attribute__((ext_vector_type(3))); +typedef uchar uchar4 __attribute__((ext_vector_type(4))); +typedef uchar uchar8 __attribute__((ext_vector_type(8))); +typedef uchar uchar16 __attribute__((ext_vector_type(16))); + +typedef ushort ushort2 __attribute__((ext_vector_type(2))); +typedef ushort ushort3 __attribute__((ext_vector_type(3))); +typedef ushort ushort4 __attribute__((ext_vector_type(4))); +typedef ushort ushort8 __attribute__((ext_vector_type(8))); +typedef ushort ushort16 __attribute__((ext_vector_type(16))); + +typedef uint uint2 __attribute__((ext_vector_type(2))); +typedef uint uint3 __attribute__((ext_vector_type(3))); +typedef uint uint4 __attribute__((ext_vector_type(4))); +typedef uint uint8 __attribute__((ext_vector_type(8))); +typedef uint uint16 __attribute__((ext_vector_type(16))); + +typedef char char2 __attribute__((ext_vector_type(2))); +typedef char char3 __attribute__((ext_vector_type(3))); +typedef char char4 __attribute__((ext_vector_type(4))); +typedef char char8 __attribute__((ext_vector_type(8))); +typedef char char16 __attribute__((ext_vector_type(16))); + +typedef short short2 __attribute__((ext_vector_type(2))); +typedef short short3 __attribute__((ext_vector_type(3))); +typedef short short4 __attribute__((ext_vector_type(4))); +typedef short short8 __attribute__((ext_vector_type(8))); +typedef short short16 __attribute__((ext_vector_type(16))); + +typedef int int2 __attribute__((ext_vector_type(2))); +typedef int int3 __attribute__((ext_vector_type(3))); +typedef int int4 __attribute__((ext_vector_type(4))); +typedef int int8 __attribute__((ext_vector_type(8))); +typedef int int16 __attribute__((ext_vector_type(16))); + + + |