diff options
| author | Stephen Hines <srhines@google.com> | 2015-07-23 02:06:55 -0700 |
|---|---|---|
| committer | Stephen Hines <srhines@google.com> | 2015-07-23 19:47:35 -0700 |
| commit | 697efc125b3a9844602551ff1de11f275761e584 (patch) | |
| tree | 4e9d770cd2fd2d4bf06f240d28d3c96f85768180 | |
| parent | 2472cb0cb3eb1f09d7929c904b35b76b83b1330d (diff) | |
| download | android_frameworks_rs-697efc125b3a9844602551ff1de11f275761e584.tar.gz android_frameworks_rs-697efc125b3a9844602551ff1de11f275761e584.tar.bz2 android_frameworks_rs-697efc125b3a9844602551ff1de11f275761e584.zip | |
Ensure that SSE-specific functions get built separately for debug runtime.
Bug: 22530323
The build rules for the debug context don't allow the SSE optimized
versions of some functions to be used. Since we bundle all of these
functions into a single file, this results in the debug runtime missing
some symbols (clamp, length, dot, sqrt). This change ensures that the
debug runtime for x86 gets the generic definitions of these functions
instead of dropping them completely.
Change-Id: Idedfbb5c1badf0b88530a7e926dda6141443ea1f
(cherry picked from commit a673fb0db28eac2300fcfa04549138c1c9202014)
| -rw-r--r-- | driver/runtime/arch/generic.c | 7 | ||||
| -rw-r--r-- | driver/runtime/rs_cl.c | 14 |
2 files changed, 15 insertions, 6 deletions
diff --git a/driver/runtime/arch/generic.c b/driver/runtime/arch/generic.c index e178ed58..9bd1bd68 100644 --- a/driver/runtime/arch/generic.c +++ b/driver/runtime/arch/generic.c @@ -79,7 +79,10 @@ extern T##4 __attribute__((overloadable)) clamp(T##4 amount, T low, T high) { return r; \ } -#if !defined(__i386__) && !defined(__x86_64__) +#if (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) +// These functions must be defined here if we are not using the SSE +// implementation, which includes when we are built as part of the +// debug runtime (libclcore_debug.bc). _CLAMP(float); @@ -93,7 +96,7 @@ extern float2 __attribute__((overloadable)) clamp(float2 amount, float low, floa extern float3 __attribute__((overloadable)) clamp(float3 amount, float low, float high); extern float4 __attribute__((overloadable)) clamp(float4 amount, float low, float high); -#endif // !defined(__i386__) && !defined(__x86_64__) +#endif // (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) _CLAMP(double); _CLAMP(char); diff --git a/driver/runtime/rs_cl.c b/driver/runtime/rs_cl.c index 3296eede..32941544 100644 --- a/driver/runtime/rs_cl.c +++ b/driver/runtime/rs_cl.c @@ -588,13 +588,16 @@ extern float __attribute__((overloadable)) rsqrt(float v) { return 1.f / sqrt(v); } -#if !defined(__i386__) && !defined(__x86_64__) +#if (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) +// These functions must be defined here if we are not using the SSE +// implementation, which includes when we are built as part of the +// debug runtime (libclcore_debug.bc). FN_FUNC_FN(sqrt) #else extern float2 __attribute__((overloadable)) sqrt(float2); extern float3 __attribute__((overloadable)) sqrt(float3); extern float4 __attribute__((overloadable)) sqrt(float4); -#endif // !defined(__i386__) && !defined(__x86_64__) +#endif // (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) FN_FUNC_FN(rsqrt) @@ -926,7 +929,10 @@ extern float4 __attribute__((overloadable)) cross(float4 lhs, float4 rhs) { return r; } -#if !defined(__i386__) && !defined(__x86_64__) +#if (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) +// These functions must be defined here if we are not using the SSE +// implementation, which includes when we are built as part of the +// debug runtime (libclcore_debug.bc). extern float __attribute__((overloadable)) dot(float lhs, float rhs) { return lhs * rhs; @@ -961,7 +967,7 @@ extern float __attribute__((overloadable)) length(float2 v); extern float __attribute__((overloadable)) length(float3 v); extern float __attribute__((overloadable)) length(float4 v); -#endif // !defined(__i386__) && !defined(__x86_64__) +#endif // (!defined(__i386__) && !defined(__x86_64__)) || defined(RS_DEBUG_RUNTIME) extern float __attribute__((overloadable)) distance(float lhs, float rhs) { return length(lhs - rhs); |
