Add code to mark functions rather than whole files as threadable.

Change-Id: Ie635fbbb96b8ade48501ec564fe135edc256537d
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index a2a08e5..c692bc1 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -400,16 +400,14 @@
     const ScriptCState::SymbolTable_t *sym;
     ScriptC *s = (ScriptC *)pContext;
     sym = ScriptCState::lookupSymbol(name);
-    if (sym) {
-        return sym->mPtr;
+    if (!sym) {
+        sym = ScriptCState::lookupSymbolCL(name);
     }
-    sym = ScriptCState::lookupSymbolCL(name);
-    if (sym) {
-        return sym->mPtr;
+    if (!sym) {
+        sym = ScriptCState::lookupSymbolGL(name);
     }
-    s->mEnviroment.mIsThreadable = false;
-    sym = ScriptCState::lookupSymbolGL(name);
     if (sym) {
+        s->mEnviroment.mIsThreadable &= sym->threadable;
         return sym->mPtr;
     }
     LOGE("ScriptC sym lookup failed for %s", name);
diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h
index e5b5ba9..86a7ad3 100644
--- a/libs/rs/rsScriptC.h
+++ b/libs/rs/rsScriptC.h
@@ -89,6 +89,7 @@
     struct SymbolTable_t {
         const char * mName;
         void * mPtr;
+        bool threadable;
     };
     //static SymbolTable_t gSyms[];
     static const SymbolTable_t * lookupSymbol(const char *);
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index 9fadee0..ecae306 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -436,120 +436,120 @@
 //                 ::= d  # double
 
 static ScriptCState::SymbolTable_t gSyms[] = {
-    { "__divsi3", (void *)&SC_divsi3 },
+    { "__divsi3", (void *)&SC_divsi3, true },
 
     // allocation
-    { "_Z19rsAllocationGetDimX13rs_allocation", (void *)&SC_allocGetDimX },
-    { "_Z19rsAllocationGetDimY13rs_allocation", (void *)&SC_allocGetDimY },
-    { "_Z19rsAllocationGetDimZ13rs_allocation", (void *)&SC_allocGetDimZ },
-    { "_Z21rsAllocationGetDimLOD13rs_allocation", (void *)&SC_allocGetDimLOD },
-    { "_Z23rsAllocationGetDimFaces13rs_allocation", (void *)&SC_allocGetDimFaces },
-    { "_Z15rsGetAllocationPKv", (void *)&SC_getAllocation },
+    { "_Z19rsAllocationGetDimX13rs_allocation", (void *)&SC_allocGetDimX, true },
+    { "_Z19rsAllocationGetDimY13rs_allocation", (void *)&SC_allocGetDimY, true },
+    { "_Z19rsAllocationGetDimZ13rs_allocation", (void *)&SC_allocGetDimZ, true },
+    { "_Z21rsAllocationGetDimLOD13rs_allocation", (void *)&SC_allocGetDimLOD, true },
+    { "_Z23rsAllocationGetDimFaces13rs_allocation", (void *)&SC_allocGetDimFaces, true },
+    { "_Z15rsGetAllocationPKv", (void *)&SC_getAllocation, true },
 
-    { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_getElementAtX },
-    { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_getElementAtXY },
-    { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_getElementAtXYZ },
+    { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_getElementAtX, true },
+    { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_getElementAtXY, true },
+    { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_getElementAtXYZ, true },
 
-    { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP10rs_element", (void *)&SC_clearObject },
-    { "_Z10rsIsObject10rs_element", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP10rs_elementS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP10rs_element", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject10rs_element", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP7rs_type", (void *)&SC_clearObject },
-    { "_Z10rsIsObject7rs_type", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP7rs_typeS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP7rs_type", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject7rs_type", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_clearObject },
-    { "_Z10rsIsObject13rs_allocation", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP13rs_allocationS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP13rs_allocation", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject13rs_allocation", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP10rs_sampler", (void *)&SC_clearObject },
-    { "_Z10rsIsObject10rs_sampler", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP10rs_samplerS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP10rs_sampler", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject10rs_sampler", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP9rs_script", (void *)&SC_clearObject },
-    { "_Z10rsIsObject9rs_script", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP9rs_scriptS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP9rs_script", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject9rs_script", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP7rs_mesh", (void *)&SC_clearObject },
-    { "_Z10rsIsObject7rs_mesh", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP7rs_meshS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP7rs_mesh", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject7rs_mesh", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_clearObject },
-    { "_Z10rsIsObject19rs_program_fragment", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP19rs_program_fragmentS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP19rs_program_fragment", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject19rs_program_fragment", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_clearObject },
-    { "_Z10rsIsObject17rs_program_vertex", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP17rs_program_vertexS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP17rs_program_vertex", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject17rs_program_vertex", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_clearObject },
-    { "_Z10rsIsObject17rs_program_raster", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP17rs_program_rasterS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP17rs_program_raster", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject17rs_program_raster", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP16rs_program_store", (void *)&SC_clearObject },
-    { "_Z10rsIsObject16rs_program_store", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP16rs_program_storeS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP16rs_program_store", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject16rs_program_store", (void *)&SC_isObject, true },
 
-    { "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_setObject },
-    { "_Z13rsClearObjectP7rs_font", (void *)&SC_clearObject },
-    { "_Z10rsIsObject7rs_font", (void *)&SC_isObject },
+    { "_Z11rsSetObjectP7rs_fontS_", (void *)&SC_setObject, true },
+    { "_Z13rsClearObjectP7rs_font", (void *)&SC_clearObject, true },
+    { "_Z10rsIsObject7rs_font", (void *)&SC_isObject, true },
 
 
-    { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_allocationMarkDirty },
+    { "_Z21rsAllocationMarkDirty13rs_allocation", (void *)&SC_allocationMarkDirty, true },
 
 
     // Debug
-    { "_Z7rsDebugPKcf", (void *)&SC_debugF },
-    { "_Z7rsDebugPKcff", (void *)&SC_debugFv2 },
-    { "_Z7rsDebugPKcfff", (void *)&SC_debugFv3 },
-    { "_Z7rsDebugPKcffff", (void *)&SC_debugFv4 },
-    { "_Z7rsDebugPKcd", (void *)&SC_debugD },
-    { "_Z7rsDebugPKcPK12rs_matrix4x4", (void *)&SC_debugFM4v4 },
-    { "_Z7rsDebugPKcPK12rs_matrix3x3", (void *)&SC_debugFM3v3 },
-    { "_Z7rsDebugPKcPK12rs_matrix2x2", (void *)&SC_debugFM2v2 },
-    { "_Z7rsDebugPKci", (void *)&SC_debugI32 },
-    { "_Z7rsDebugPKcj", (void *)&SC_debugU32 },
+    { "_Z7rsDebugPKcf", (void *)&SC_debugF, true },
+    { "_Z7rsDebugPKcff", (void *)&SC_debugFv2, true },
+    { "_Z7rsDebugPKcfff", (void *)&SC_debugFv3, true },
+    { "_Z7rsDebugPKcffff", (void *)&SC_debugFv4, true },
+    { "_Z7rsDebugPKcd", (void *)&SC_debugD, true },
+    { "_Z7rsDebugPKcPK12rs_matrix4x4", (void *)&SC_debugFM4v4, true },
+    { "_Z7rsDebugPKcPK12rs_matrix3x3", (void *)&SC_debugFM3v3, true },
+    { "_Z7rsDebugPKcPK12rs_matrix2x2", (void *)&SC_debugFM2v2, true },
+    { "_Z7rsDebugPKci", (void *)&SC_debugI32, true },
+    { "_Z7rsDebugPKcj", (void *)&SC_debugU32, true },
     // Both "long" and "unsigned long" need to be redirected to their
     // 64-bit counterparts, since we have hacked Slang to use 64-bit
     // for "long" on Arm (to be similar to Java).
-    { "_Z7rsDebugPKcl", (void *)&SC_debugLL64 },
-    { "_Z7rsDebugPKcm", (void *)&SC_debugULL64 },
-    { "_Z7rsDebugPKcx", (void *)&SC_debugLL64 },
-    { "_Z7rsDebugPKcy", (void *)&SC_debugULL64 },
-    { "_Z7rsDebugPKcPKv", (void *)&SC_debugP },
+    { "_Z7rsDebugPKcl", (void *)&SC_debugLL64, true },
+    { "_Z7rsDebugPKcm", (void *)&SC_debugULL64, true },
+    { "_Z7rsDebugPKcx", (void *)&SC_debugLL64, true },
+    { "_Z7rsDebugPKcy", (void *)&SC_debugULL64, true },
+    { "_Z7rsDebugPKcPKv", (void *)&SC_debugP, true },
 
     // RS Math
-    { "_Z6rsRandi", (void *)&SC_randi },
-    { "_Z6rsRandii", (void *)&SC_randi2 },
-    { "_Z6rsRandf", (void *)&SC_randf },
-    { "_Z6rsRandff", (void *)&SC_randf2 },
-    { "_Z6rsFracf", (void *)&SC_frac },
+    { "_Z6rsRandi", (void *)&SC_randi, true },
+    { "_Z6rsRandii", (void *)&SC_randi2, true },
+    { "_Z6rsRandf", (void *)&SC_randf, true },
+    { "_Z6rsRandff", (void *)&SC_randf2, true },
+    { "_Z6rsFracf", (void *)&SC_frac, true },
 
     // time
-    { "_Z8rsSecondv", (void *)&SC_second },
-    { "_Z8rsMinutev", (void *)&SC_minute },
-    { "_Z6rsHourv", (void *)&SC_hour },
-    { "_Z5rsDayv", (void *)&SC_day },
-    { "_Z7rsMonthv", (void *)&SC_month },
-    { "_Z6rsYearv", (void *)&SC_year },
-    { "_Z14rsUptimeMillisv", (void*)&SC_uptimeMillis },
-    { "_Z13rsUptimeNanosv", (void*)&SC_uptimeNanos },
-    { "_Z7rsGetDtv", (void*)&SC_getDt },
+    { "_Z8rsSecondv", (void *)&SC_second, true },
+    { "_Z8rsMinutev", (void *)&SC_minute, true },
+    { "_Z6rsHourv", (void *)&SC_hour, true },
+    { "_Z5rsDayv", (void *)&SC_day, true },
+    { "_Z7rsMonthv", (void *)&SC_month, true },
+    { "_Z6rsYearv", (void *)&SC_year, true },
+    { "_Z14rsUptimeMillisv", (void*)&SC_uptimeMillis, true },
+    { "_Z13rsUptimeNanosv", (void*)&SC_uptimeNanos, true },
+    { "_Z7rsGetDtv", (void*)&SC_getDt, false },
 
-    { "_Z14rsSendToClienti", (void *)&SC_toClient },
-    { "_Z14rsSendToClientiPKvj", (void *)&SC_toClient2 },
-    { "_Z22rsSendToClientBlockingi", (void *)&SC_toClientBlocking },
-    { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_toClientBlocking2 },
+    { "_Z14rsSendToClienti", (void *)&SC_toClient, false },
+    { "_Z14rsSendToClientiPKvj", (void *)&SC_toClient2, false },
+    { "_Z22rsSendToClientBlockingi", (void *)&SC_toClientBlocking, false },
+    { "_Z22rsSendToClientBlockingiPKvj", (void *)&SC_toClientBlocking2, false },
 
-    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach },
-    //{ "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach2 },
+    { "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach, false },
+    //{ "_Z9rsForEach9rs_script13rs_allocationS0_PKv", (void *)&SC_ForEach2, true },
 
 ////////////////////////////////////////////////////////////////////
 
-    //{ "sinf_fast", (void *)&SC_sinf_fast },
-    //{ "cosf_fast", (void *)&SC_cosf_fast },
+    //{ "sinf_fast", (void *)&SC_sinf_fast, true },
+    //{ "cosf_fast", (void *)&SC_cosf_fast, true },
 
-    { NULL, NULL }
+    { NULL, NULL, false }
 };
 
 const ScriptCState::SymbolTable_t * ScriptCState::lookupSymbol(const char *sym)
diff --git a/libs/rs/rsScriptC_LibCL.cpp b/libs/rs/rsScriptC_LibCL.cpp
index 1b1a752..7031f84 100644
--- a/libs/rs/rsScriptC_LibCL.cpp
+++ b/libs/rs/rsScriptC_LibCL.cpp
@@ -88,11 +88,6 @@
     return tanf(v * M_PI);
 }
 
-    //{ "logb", (void *)& },
-    //{ "mad", (void *)& },
-    //{ "nan", (void *)& },
-    //{ "tgamma", (void *)& },
-
 //////////////////////////////////////////////////////////////////////////////
 // Integer
 //////////////////////////////////////////////////////////////////////////////
@@ -198,105 +193,105 @@
 
 static ScriptCState::SymbolTable_t gSyms[] = {
     // OpenCL math
-    { "_Z4acosf", (void *)&acosf },
-    { "_Z5acoshf", (void *)&acoshf },
-    { "_Z6acospif", (void *)&SC_acospi },
-    { "_Z4asinf", (void *)&asinf },
-    { "_Z5asinhf", (void *)&asinhf },
-    { "_Z6asinpif", (void *)&SC_asinpi },
-    { "_Z4atanf", (void *)&atanf },
-    { "_Z5atan2ff", (void *)&atan2f },
-    { "_Z6atanpif", (void *)&SC_atanpi },
-    { "_Z7atan2piff", (void *)&SC_atan2pi },
-    { "_Z4cbrtf", (void *)&cbrtf },
-    { "_Z4ceilf", (void *)&ceilf },
-    { "_Z8copysignff", (void *)&copysignf },
-    { "_Z3cosf", (void *)&cosf },
-    { "_Z4coshf", (void *)&coshf },
-    { "_Z5cospif", (void *)&SC_cospi },
-    { "_Z4erfcf", (void *)&erfcf },
-    { "_Z3erff", (void *)&erff },
-    { "_Z3expf", (void *)&expf },
-    { "_Z4exp2f", (void *)&exp2f },
-    { "_Z5exp10f", (void *)&SC_exp10 },
-    { "_Z5expm1f", (void *)&expm1f },
-    { "_Z4fabsf", (void *)&fabsf },
-    { "_Z4fdimff", (void *)&fdimf },
-    { "_Z5floorf", (void *)&floorf },
-    { "_Z3fmafff", (void *)&fmaf },
-    { "_Z4fmaxff", (void *)&fmaxf },
-    { "_Z4fminff", (void *)&fminf },  // float fmin(float, float)
-    { "_Z4fmodff", (void *)&fmodf },
-    { "_Z5fractfPf", (void *)&SC_fract },
-    { "_Z5frexpfPi", (void *)&frexpf },
-    { "_Z5hypotff", (void *)&hypotf },
-    { "_Z5ilogbf", (void *)&ilogbf },
-    { "_Z5ldexpfi", (void *)&ldexpf },
-    { "_Z6lgammaf", (void *)&lgammaf },
-    { "_Z3logf", (void *)&logf },
-    { "_Z4log2f", (void *)&SC_log2 },
-    { "_Z5log10f", (void *)&log10f },
-    { "_Z5log1pf", (void *)&log1pf },
-    //{ "logb", (void *)& },
-    //{ "mad", (void *)& },
-    { "modf", (void *)&modff },
-    //{ "nan", (void *)& },
-    { "_Z9nextafterff", (void *)&nextafterf },
-    { "_Z3powff", (void *)&powf },
-    { "_Z4pownfi", (void *)&SC_pown },
-    { "_Z4powrff", (void *)&SC_powr },
-    { "_Z9remainderff", (void *)&remainderf },
-    { "remquo", (void *)&remquof },
-    { "_Z4rintf", (void *)&rintf },
-    { "_Z5rootnfi", (void *)&SC_rootn },
-    { "_Z5roundf", (void *)&roundf },
-    { "_Z5rsqrtf", (void *)&SC_rsqrt },
-    { "_Z3sinf", (void *)&sinf },
-    { "sincos", (void *)&SC_sincos },
-    { "_Z4sinhf", (void *)&sinhf },
-    { "_Z5sinpif", (void *)&SC_sinpi },
-    { "_Z4sqrtf", (void *)&sqrtf },
-    { "_Z3tanf", (void *)&tanf },
-    { "_Z4tanhf", (void *)&tanhf },
-    { "_Z5tanpif", (void *)&SC_tanpi },
-    //{ "tgamma", (void *)& },
-    { "_Z5truncf", (void *)&truncf },
+    { "_Z4acosf", (void *)&acosf, true },
+    { "_Z5acoshf", (void *)&acoshf, true },
+    { "_Z6acospif", (void *)&SC_acospi, true },
+    { "_Z4asinf", (void *)&asinf, true },
+    { "_Z5asinhf", (void *)&asinhf, true },
+    { "_Z6asinpif", (void *)&SC_asinpi, true },
+    { "_Z4atanf", (void *)&atanf, true },
+    { "_Z5atan2ff", (void *)&atan2f, true },
+    { "_Z6atanpif", (void *)&SC_atanpi, true },
+    { "_Z7atan2piff", (void *)&SC_atan2pi, true },
+    { "_Z4cbrtf", (void *)&cbrtf, true },
+    { "_Z4ceilf", (void *)&ceilf, true },
+    { "_Z8copysignff", (void *)&copysignf, true },
+    { "_Z3cosf", (void *)&cosf, true },
+    { "_Z4coshf", (void *)&coshf, true },
+    { "_Z5cospif", (void *)&SC_cospi, true },
+    { "_Z4erfcf", (void *)&erfcf, true },
+    { "_Z3erff", (void *)&erff, true },
+    { "_Z3expf", (void *)&expf, true },
+    { "_Z4exp2f", (void *)&exp2f, true },
+    { "_Z5exp10f", (void *)&SC_exp10, true },
+    { "_Z5expm1f", (void *)&expm1f, true },
+    { "_Z4fabsf", (void *)&fabsf, true },
+    { "_Z4fdimff", (void *)&fdimf, true },
+    { "_Z5floorf", (void *)&floorf, true },
+    { "_Z3fmafff", (void *)&fmaf, true },
+    { "_Z4fmaxff", (void *)&fmaxf, true },
+    { "_Z4fminff", (void *)&fminf, true },  // float fmin(float, float)
+    { "_Z4fmodff", (void *)&fmodf, true },
+    { "_Z5fractfPf", (void *)&SC_fract, true },
+    { "_Z5frexpfPi", (void *)&frexpf, true },
+    { "_Z5hypotff", (void *)&hypotf, true },
+    { "_Z5ilogbf", (void *)&ilogbf, true },
+    { "_Z5ldexpfi", (void *)&ldexpf, true },
+    { "_Z6lgammaf", (void *)&lgammaf, true },
+    { "_Z3logf", (void *)&logf, true },
+    { "_Z4log2f", (void *)&SC_log2, true },
+    { "_Z5log10f", (void *)&log10f, true },
+    { "_Z5log1pf", (void *)&log1pf, true },
+    //{ "logb", (void *)&, true },
+    //{ "mad", (void *)&, true },
+    { "modf", (void *)&modff, true },
+    //{ "nan", (void *)&, true },
+    { "_Z9nextafterff", (void *)&nextafterf, true },
+    { "_Z3powff", (void *)&powf, true },
+    { "_Z4pownfi", (void *)&SC_pown, true },
+    { "_Z4powrff", (void *)&SC_powr, true },
+    { "_Z9remainderff", (void *)&remainderf, true },
+    { "remquo", (void *)&remquof, true },
+    { "_Z4rintf", (void *)&rintf, true },
+    { "_Z5rootnfi", (void *)&SC_rootn, true },
+    { "_Z5roundf", (void *)&roundf, true },
+    { "_Z5rsqrtf", (void *)&SC_rsqrt, true },
+    { "_Z3sinf", (void *)&sinf, true },
+    { "sincos", (void *)&SC_sincos, true },
+    { "_Z4sinhf", (void *)&sinhf, true },
+    { "_Z5sinpif", (void *)&SC_sinpi, true },
+    { "_Z4sqrtf", (void *)&sqrtf, true },
+    { "_Z3tanf", (void *)&tanf, true },
+    { "_Z4tanhf", (void *)&tanhf, true },
+    { "_Z5tanpif", (void *)&SC_tanpi, true },
+    //{ "tgamma", (void *)&, true },
+    { "_Z5truncf", (void *)&truncf, true },
 
     // OpenCL Int
-    { "_Z3absi", (void *)&SC_abs_i32 },
-    { "_Z3abss", (void *)&SC_abs_i16 },
-    { "_Z3absc", (void *)&SC_abs_i8 },
-    { "_Z3clzj", (void *)&SC_clz_u32 },
-    { "_Z3clzt", (void *)&SC_clz_u16 },
-    { "_Z3clzh", (void *)&SC_clz_u8 },
-    { "_Z3clzi", (void *)&SC_clz_i32 },
-    { "_Z3clzs", (void *)&SC_clz_i16 },
-    { "_Z3clzc", (void *)&SC_clz_i8 },
-    { "_Z3maxjj", (void *)&SC_max_u32 },
-    { "_Z3maxtt", (void *)&SC_max_u16 },
-    { "_Z3maxhh", (void *)&SC_max_u8 },
-    { "_Z3maxii", (void *)&SC_max_i32 },
-    { "_Z3maxss", (void *)&SC_max_i16 },
-    { "_Z3maxcc", (void *)&SC_max_i8 },
-    { "_Z3minjj", (void *)&SC_min_u32 },
-    { "_Z3mintt", (void *)&SC_min_u16 },
-    { "_Z3minhh", (void *)&SC_min_u8 },
-    { "_Z3minii", (void *)&SC_min_i32 },
-    { "_Z3minss", (void *)&SC_min_i16 },
-    { "_Z3mincc", (void *)&SC_min_i8 },
+    { "_Z3absi", (void *)&SC_abs_i32, true },
+    { "_Z3abss", (void *)&SC_abs_i16, true },
+    { "_Z3absc", (void *)&SC_abs_i8, true },
+    { "_Z3clzj", (void *)&SC_clz_u32, true },
+    { "_Z3clzt", (void *)&SC_clz_u16, true },
+    { "_Z3clzh", (void *)&SC_clz_u8, true },
+    { "_Z3clzi", (void *)&SC_clz_i32, true },
+    { "_Z3clzs", (void *)&SC_clz_i16, true },
+    { "_Z3clzc", (void *)&SC_clz_i8, true },
+    { "_Z3maxjj", (void *)&SC_max_u32, true },
+    { "_Z3maxtt", (void *)&SC_max_u16, true },
+    { "_Z3maxhh", (void *)&SC_max_u8, true },
+    { "_Z3maxii", (void *)&SC_max_i32, true },
+    { "_Z3maxss", (void *)&SC_max_i16, true },
+    { "_Z3maxcc", (void *)&SC_max_i8, true },
+    { "_Z3minjj", (void *)&SC_min_u32, true },
+    { "_Z3mintt", (void *)&SC_min_u16, true },
+    { "_Z3minhh", (void *)&SC_min_u8, true },
+    { "_Z3minii", (void *)&SC_min_i32, true },
+    { "_Z3minss", (void *)&SC_min_i16, true },
+    { "_Z3mincc", (void *)&SC_min_i8, true },
 
     // OpenCL 6.11.4
-    { "_Z5clampfff", (void *)&SC_clamp_f32 },
-    { "_Z7degreesf", (void *)&SC_degrees },
-    { "_Z3maxff", (void *)&SC_max_f32 },
-    { "_Z3minff", (void *)&SC_min_f32 },
-    { "_Z3mixfff", (void *)&SC_mix_f32 },
-    { "_Z7radiansf", (void *)&SC_radians },
-    { "_Z4stepff", (void *)&SC_step_f32 },
-    //{ "smoothstep", (void *)& },
-    { "_Z4signf", (void *)&SC_sign_f32 },
+    { "_Z5clampfff", (void *)&SC_clamp_f32, true },
+    { "_Z7degreesf", (void *)&SC_degrees, true },
+    { "_Z3maxff", (void *)&SC_max_f32, true },
+    { "_Z3minff", (void *)&SC_min_f32, true },
+    { "_Z3mixfff", (void *)&SC_mix_f32, true },
+    { "_Z7radiansf", (void *)&SC_radians, true },
+    { "_Z4stepff", (void *)&SC_step_f32, true },
+    //{ "smoothstep", (void *)&, true },
+    { "_Z4signf", (void *)&SC_sign_f32, true },
 
-    { NULL, NULL }
+    { NULL, NULL, false }
 };
 
 const ScriptCState::SymbolTable_t * ScriptCState::lookupSymbolCL(const char *sym)
diff --git a/libs/rs/rsScriptC_LibGL.cpp b/libs/rs/rsScriptC_LibGL.cpp
index b991cab..5b07e7b 100644
--- a/libs/rs/rsScriptC_LibGL.cpp
+++ b/libs/rs/rsScriptC_LibGL.cpp
@@ -441,53 +441,53 @@
 //                 ::= d  # double
 
 static ScriptCState::SymbolTable_t gSyms[] = {
-    { "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_bindProgramFragment },
-    { "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_bindProgramStore },
-    { "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_bindProgramVertex },
-    { "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_bindProgramRaster },
-    { "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_bindSampler },
-    { "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_bindTexture },
+    { "_Z22rsgBindProgramFragment19rs_program_fragment", (void *)&SC_bindProgramFragment, false },
+    { "_Z19rsgBindProgramStore16rs_program_store", (void *)&SC_bindProgramStore, false },
+    { "_Z20rsgBindProgramVertex17rs_program_vertex", (void *)&SC_bindProgramVertex, false },
+    { "_Z20rsgBindProgramRaster17rs_program_raster", (void *)&SC_bindProgramRaster, false },
+    { "_Z14rsgBindSampler19rs_program_fragmentj10rs_sampler", (void *)&SC_bindSampler, false },
+    { "_Z14rsgBindTexture19rs_program_fragmentj13rs_allocation", (void *)&SC_bindTexture, false },
 
-    { "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadProjectionMatrix },
-    { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadModelMatrix },
-    { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadTextureMatrix },
+    { "_Z36rsgProgramVertexLoadProjectionMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadProjectionMatrix, false },
+    { "_Z31rsgProgramVertexLoadModelMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadModelMatrix, false },
+    { "_Z33rsgProgramVertexLoadTextureMatrixPK12rs_matrix4x4", (void *)&SC_vpLoadTextureMatrix, false },
 
-    { "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_vpGetProjectionMatrix },
+    { "_Z35rsgProgramVertexGetProjectionMatrixP12rs_matrix4x4", (void *)&SC_vpGetProjectionMatrix, false },
 
-    { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_pfConstantColor },
+    { "_Z31rsgProgramFragmentConstantColor19rs_program_fragmentffff", (void *)&SC_pfConstantColor, false },
 
-    { "_Z11rsgGetWidthv", (void *)&SC_getWidth },
-    { "_Z12rsgGetHeightv", (void *)&SC_getHeight },
+    { "_Z11rsgGetWidthv", (void *)&SC_getWidth, false },
+    { "_Z12rsgGetHeightv", (void *)&SC_getHeight, false },
 
-    { "_Z18rsgUploadToTexture13rs_allocationj", (void *)&SC_uploadToTexture2 },
-    { "_Z18rsgUploadToTexture13rs_allocation", (void *)&SC_uploadToTexture },
-    { "_Z23rsgUploadToBufferObject13rs_allocation", (void *)&SC_uploadToBufferObject },
+    { "_Z18rsgUploadToTexture13rs_allocationj", (void *)&SC_uploadToTexture2, false },
+    { "_Z18rsgUploadToTexture13rs_allocation", (void *)&SC_uploadToTexture, false },
+    { "_Z23rsgUploadToBufferObject13rs_allocation", (void *)&SC_uploadToBufferObject, false },
 
-    { "_Z11rsgDrawRectfffff", (void *)&SC_drawRect },
-    { "_Z11rsgDrawQuadffffffffffff", (void *)&SC_drawQuad },
-    { "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_drawQuadTexCoords },
-    { "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_drawSpriteScreenspace },
+    { "_Z11rsgDrawRectfffff", (void *)&SC_drawRect, false },
+    { "_Z11rsgDrawQuadffffffffffff", (void *)&SC_drawQuad, false },
+    { "_Z20rsgDrawQuadTexCoordsffffffffffffffffffff", (void *)&SC_drawQuadTexCoords, false },
+    { "_Z24rsgDrawSpriteScreenspacefffff", (void *)&SC_drawSpriteScreenspace, false },
 
-    { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_drawMesh },
-    { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_drawMeshPrimitive },
-    { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_drawMeshPrimitiveRange },
-    { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_meshComputeBoundingBox },
+    { "_Z11rsgDrawMesh7rs_mesh", (void *)&SC_drawMesh, false },
+    { "_Z11rsgDrawMesh7rs_meshj", (void *)&SC_drawMeshPrimitive, false },
+    { "_Z11rsgDrawMesh7rs_meshjjj", (void *)&SC_drawMeshPrimitiveRange, false },
+    { "_Z25rsgMeshComputeBoundingBox7rs_meshPfS0_S0_S0_S0_S0_", (void *)&SC_meshComputeBoundingBox, false },
 
-    { "_Z13rsgClearColorffff", (void *)&SC_ClearColor },
-    { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth },
+    { "_Z13rsgClearColorffff", (void *)&SC_ClearColor, false },
+    { "_Z13rsgClearDepthf", (void *)&SC_ClearDepth, false },
 
-    { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText },
-    { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc },
-    { "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText },
-    { "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc },
+    { "_Z11rsgDrawTextPKcii", (void *)&SC_DrawText, false },
+    { "_Z11rsgDrawText13rs_allocationii", (void *)&SC_DrawTextAlloc, false },
+    { "_Z14rsgMeasureTextPKcPiS1_S1_S1_", (void *)&SC_MeasureText, false },
+    { "_Z14rsgMeasureText13rs_allocationPiS0_S0_S0_", (void *)&SC_MeasureTextAlloc, false },
 
-    { "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont },
-    { "_Z12rsgFontColorffff", (void *)&SC_FontColor },
+    { "_Z11rsgBindFont7rs_font", (void *)&SC_BindFont, false },
+    { "_Z12rsgFontColorffff", (void *)&SC_FontColor, false },
 
     // misc
-    { "_Z5colorffff", (void *)&SC_color },
+    { "_Z5colorffff", (void *)&SC_color, false },
 
-    { NULL, NULL }
+    { NULL, NULL, false }
 };
 
 const ScriptCState::SymbolTable_t * ScriptCState::lookupSymbolGL(const char *sym)