diff options
author | Stephen Hines <srhines@google.com> | 2011-01-24 12:03:51 -0800 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2011-01-24 13:56:30 -0800 |
commit | 7e893e1ddfbca2e46c5af1be2e431ec2edb3fbd0 (patch) | |
tree | 4a986f2b11cad87850b2d026adc04c400af7612b /libs/rs/rsScriptC_Lib.cpp | |
parent | da6f9295840b0e74f61afa273ce2a767d8148af7 (diff) |
Add missing functions to math library.
This also updates the math test suite to exercise all the basic operator
functions (except __udivsi3 which may not be 100% necessary). There is also a
small fix for rsQuaternionMultiply().
Change-Id: Id157e6d5ebe2e20c17e8ea7b13ffaa74c241838c
b: 3203577
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index f550d9870b06..beb4d724e05e 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -305,6 +305,14 @@ int SC_modsi3(int a, int b) { return a % b; } +unsigned int SC_udivsi3(unsigned int a, unsigned int b) { + return a / b; +} + +unsigned int SC_umodsi3(unsigned int a, unsigned int b) { + return a % b; +} + int SC_getAllocation(const void *ptr) { GET_TLS(); const Allocation *alloc = sc->ptrToAllocation(ptr); @@ -363,6 +371,8 @@ void SC_ForEach2(RsScript vs, static ScriptCState::SymbolTable_t gSyms[] = { { "__divsi3", (void *)&SC_divsi3, true }, { "__modsi3", (void *)&SC_modsi3, true }, + { "__udivsi3", (void *)&SC_udivsi3, true }, + { "__umodsi3", (void *)&SC_umodsi3, true }, // allocation { "_Z19rsAllocationGetDimX13rs_allocation", (void *)&SC_allocGetDimX, true }, |