Implement optimized clamp.
Provide both generic C impl file and optimized
neon path. Makefile will need switch to build both.
Change-Id: I24cc80de03260a9053eff7dc8e64dc7fe03a92ac
diff --git a/lib/ScriptCRT/rs_core.c b/lib/ScriptCRT/rs_core.c
index c9bf3be..f655c05 100644
--- a/lib/ScriptCRT/rs_core.c
+++ b/lib/ScriptCRT/rs_core.c
@@ -190,9 +190,9 @@
// int ops
/////////////////////////////////////////////////////
-/*extern uint __attribute__((overloadable, always_inline)) rsClamp(uint amount, uint low, uint high) {
+extern uint __attribute__((overloadable, always_inline)) rsClamp(uint amount, uint low, uint high) {
return amount < low ? low : (amount > high ? high : amount);
-}*/
+}
extern int __attribute__((overloadable, always_inline)) rsClamp(int amount, int low, int high) {
return amount < low ? low : (amount > high ? high : amount);
}