summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu_ref/rsCpuScript.cpp49
-rw-r--r--cpu_ref/rsCpuScript.h6
-rw-r--r--rsScriptC.cpp10
-rw-r--r--rsScriptC.h6
4 files changed, 8 insertions, 63 deletions
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index 432312b9..e7c68b06 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -17,7 +17,6 @@
#include "rsCpuCore.h"
#include "rsCpuScript.h"
-#ifndef FAKE_ARM64_BUILD
#ifdef RS_COMPATIBILITY_LIB
#include <set>
#include <string>
@@ -43,10 +42,8 @@
#include <string>
#include <vector>
#endif
-#endif
namespace {
-#ifndef FAKE_ARM64_BUILD
#ifdef RS_COMPATIBILITY_LIB
// Create a len length string containing random characters from [A-Za-z0-9].
@@ -194,7 +191,7 @@ static void *loadSharedLibrary(const char *cacheDir, const char *resName) {
}
-#else
+#else // RS_COMPATIBILITY_LIB is defined
static bool is_force_recompile() {
#ifdef RS_SERVER
return false;
@@ -311,7 +308,6 @@ static bool compileBitcode(const char *cacheDir,
}
#endif // !defined(RS_COMPATIBILITY_LIB)
-#endif
} // namespace
namespace android {
@@ -360,7 +356,6 @@ RsdCpuScriptImpl::RsdCpuScriptImpl(RsdCpuReferenceImpl *ctx, const Script *s) {
mCtx = ctx;
mScript = s;
-#ifndef FAKE_ARM64_BUILD
#ifdef RS_COMPATIBILITY_LIB
mScriptSO = NULL;
mInvokeFunctions = NULL;
@@ -384,7 +379,6 @@ RsdCpuScriptImpl::RsdCpuScriptImpl(RsdCpuReferenceImpl *ctx, const Script *s) {
mBoundAllocs = NULL;
mIntrinsicData = NULL;
mIsThreadable = true;
-#endif
}
@@ -395,7 +389,6 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir,
//ALOGE("rsdScriptInit %p %p", rsc, script);
mCtx->lockMutex();
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
bcc::RSExecutable *exec = NULL;
bool useRSDebugContext = false;
@@ -519,7 +512,7 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir,
ME.getExportForEachSignatureList()[i]));
}
-#else
+#else // RS_COMPATIBILITY_LIB is defined
mScriptSO = loadSharedLibrary(cacheDir, resName);
@@ -718,7 +711,6 @@ bool RsdCpuScriptImpl::init(char const *resName, char const *cacheDir,
goto error;
}
#endif
-#endif // FAKE_ARM64_BUILD
mCtx->unlockMutex();
return true;
@@ -740,7 +732,6 @@ error:
}
void RsdCpuScriptImpl::populateScript(Script *script) {
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
// Copy info over to runtime
script->mHal.info.exportedFunctionCount = mExecutable->getExportFuncAddrs().size();
@@ -772,7 +763,6 @@ void RsdCpuScriptImpl::populateScript(Script *script) {
script->mHal.info.root = mRoot;
}
#endif
-#endif
}
@@ -897,7 +887,6 @@ void RsdCpuScriptImpl::invokeForEach(uint32_t slot,
void RsdCpuScriptImpl::forEachKernelSetup(uint32_t slot, MTLaunchStruct *mtls) {
mtls->script = this;
mtls->fep.slot = slot;
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
rsAssert(slot < mExecutable->getExportForeachFuncAddrs().size());
mtls->kernel = reinterpret_cast<ForEachFunc_t>(
@@ -909,34 +898,25 @@ void RsdCpuScriptImpl::forEachKernelSetup(uint32_t slot, MTLaunchStruct *mtls) {
rsAssert(mtls->kernel != NULL);
mtls->sig = mForEachSignatures[slot];
#endif
-#endif
}
int RsdCpuScriptImpl::invokeRoot() {
RsdCpuScriptImpl * oldTLS = mCtx->setTLS(this);
-#ifndef FAKE_ARM64_BUILD
int ret = mRoot();
-#else
- int ret = 0;
-#endif
mCtx->setTLS(oldTLS);
return ret;
}
void RsdCpuScriptImpl::invokeInit() {
-#ifndef FAKE_ARM64_BUILD
if (mInit) {
mInit();
}
-#endif
}
void RsdCpuScriptImpl::invokeFreeChildren() {
-#ifndef FAKE_ARM64_BUILD
if (mFreeChildren) {
mFreeChildren();
}
-#endif
}
void RsdCpuScriptImpl::invokeFunction(uint32_t slot, const void *params,
@@ -944,14 +924,12 @@ void RsdCpuScriptImpl::invokeFunction(uint32_t slot, const void *params,
//ALOGE("invoke %p %p %i %p %i", dc, script, slot, params, paramLength);
RsdCpuScriptImpl * oldTLS = mCtx->setTLS(this);
-#ifndef FAKE_ARM64_BUILD
reinterpret_cast<void (*)(const void *, uint32_t)>(
#ifndef RS_COMPATIBILITY_LIB
mExecutable->getExportFuncAddrs()[slot])(params, paramLength);
#else
mInvokeFunctions[slot])(params, paramLength);
#endif
-#endif
mCtx->setTLS(oldTLS);
}
@@ -964,16 +942,12 @@ void RsdCpuScriptImpl::setGlobalVar(uint32_t slot, const void *data, size_t data
//return;
//}
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int32_t *destPtr = reinterpret_cast<int32_t *>(
mExecutable->getExportVarAddrs()[slot]);
#else
int32_t *destPtr = reinterpret_cast<int32_t *>(mFieldAddress[slot]);
#endif
-#else
- int32_t *destPtr = NULL;
-#endif
if (!destPtr) {
//ALOGV("Calling setVar on slot = %i which is null", slot);
return;
@@ -986,16 +960,12 @@ void RsdCpuScriptImpl::getGlobalVar(uint32_t slot, void *data, size_t dataLength
//rsAssert(!script->mFieldIsObject[slot]);
//ALOGE("getGlobalVar %p %p %i %p %i", dc, script, slot, data, dataLength);
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int32_t *srcPtr = reinterpret_cast<int32_t *>(
mExecutable->getExportVarAddrs()[slot]);
#else
int32_t *srcPtr = reinterpret_cast<int32_t *>(mFieldAddress[slot]);
#endif
-#else
- int32_t *srcPtr = NULL;
-#endif
if (!srcPtr) {
//ALOGV("Calling setVar on slot = %i which is null", slot);
return;
@@ -1008,16 +978,12 @@ void RsdCpuScriptImpl::setGlobalVarWithElemDims(uint32_t slot, const void *data,
const Element *elem,
const size_t *dims, size_t dimLength) {
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int32_t *destPtr = reinterpret_cast<int32_t *>(
mExecutable->getExportVarAddrs()[slot]);
#else
int32_t *destPtr = reinterpret_cast<int32_t *>(mFieldAddress[slot]);
#endif
-#else
- int32_t *destPtr = NULL;
-#endif
if (!destPtr) {
//ALOGV("Calling setVar on slot = %i which is null", slot);
return;
@@ -1054,16 +1020,12 @@ void RsdCpuScriptImpl::setGlobalBind(uint32_t slot, Allocation *data) {
//rsAssert(!script->mFieldIsObject[slot]);
//ALOGE("setGlobalBind %p %p %i %p", dc, script, slot, data);
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int32_t *destPtr = reinterpret_cast<int32_t *>(
mExecutable->getExportVarAddrs()[slot]);
#else
int32_t *destPtr = reinterpret_cast<int32_t *>(mFieldAddress[slot]);
#endif
-#else
- int32_t *destPtr = NULL;
-#endif
if (!destPtr) {
//ALOGV("Calling setVar on slot = %i which is null", slot);
return;
@@ -1087,17 +1049,12 @@ void RsdCpuScriptImpl::setGlobalObj(uint32_t slot, ObjectBase *data) {
//return;
//}
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int32_t *destPtr = reinterpret_cast<int32_t *>(
mExecutable->getExportVarAddrs()[slot]);
#else
int32_t *destPtr = reinterpret_cast<int32_t *>(mFieldAddress[slot]);
#endif
-#else
- int32_t *destPtr = NULL;
-#endif
-
if (!destPtr) {
//ALOGV("Calling setVar on slot = %i which is null", slot);
@@ -1108,7 +1065,6 @@ void RsdCpuScriptImpl::setGlobalObj(uint32_t slot, ObjectBase *data) {
}
RsdCpuScriptImpl::~RsdCpuScriptImpl() {
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
if (mExecutable) {
Vector<void *>::const_iterator var_addr_iter =
@@ -1176,7 +1132,6 @@ RsdCpuScriptImpl::~RsdCpuScriptImpl() {
dlclose(mScriptSO);
}
#endif
-#endif
}
Allocation * RsdCpuScriptImpl::getAllocationForPointer(const void *ptr) const {
diff --git a/cpu_ref/rsCpuScript.h b/cpu_ref/rsCpuScript.h
index 1fe66ce2..f26a1bc9 100644
--- a/cpu_ref/rsCpuScript.h
+++ b/cpu_ref/rsCpuScript.h
@@ -99,19 +99,14 @@ public:
virtual Allocation * getAllocationForPointer(const void *ptr) const;
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
virtual void * getRSExecutable() { return mExecutable; }
#endif
-#else
- virtual void* getRSExecutable() { return NULL; }
-#endif
protected:
RsdCpuReferenceImpl *mCtx;
const Script *mScript;
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
int (*mRoot)();
int (*mRootExpand)();
@@ -145,7 +140,6 @@ protected:
size_t mExportedVariableCount;
size_t mExportedFunctionCount;
#endif
-#endif
Allocation **mBoundAllocs;
void * mIntrinsicData;
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 3a22b163..ab263c83 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -17,7 +17,7 @@
#include "rsContext.h"
#include "rsScriptC.h"
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
+#if !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
#include <bcinfo/BitcodeTranslator.h>
#include <bcinfo/BitcodeWrapper.h>
#endif
@@ -38,13 +38,13 @@ using namespace android::renderscript;
ScriptC * sc = (ScriptC *) tls->mScript
ScriptC::ScriptC(Context *rsc) : Script(rsc) {
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
+#if !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
BT = NULL;
#endif
}
ScriptC::~ScriptC() {
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
+#if !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
if (BT) {
delete BT;
BT = NULL;
@@ -56,7 +56,6 @@ ScriptC::~ScriptC() {
}
}
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
bool ScriptC::createCacheDir(const char *cacheDir) {
String8 cacheDirString, currentDir;
@@ -95,7 +94,6 @@ bool ScriptC::createCacheDir(const char *cacheDir) {
return true;
}
#endif
-#endif
void ScriptC::setupScript(Context *rsc) {
#ifndef RS_SERVER
@@ -208,7 +206,6 @@ bool ScriptC::runCompiler(Context *rsc,
size_t bitcodeLen) {
ATRACE_CALL();
//ALOGE("runCompiler %p %p %p %p %p %i", rsc, this, resName, cacheDir, bitcode, bitcodeLen);
-#ifndef FAKE_ARM64_BUILD
#ifndef RS_COMPATIBILITY_LIB
#ifndef ANDROID_RS_SERIALIZE
uint32_t sdkVersion = 0;
@@ -254,7 +251,6 @@ bool ScriptC::runCompiler(Context *rsc,
return false;
}
#endif
-#endif
if (!rsc->mHal.funcs.script.init(rsc, this, resName, cacheDir, bitcode, bitcodeLen, 0)) {
return false;
diff --git a/rsScriptC.h b/rsScriptC.h
index 4a033f15..d26cde04 100644
--- a/rsScriptC.h
+++ b/rsScriptC.h
@@ -20,7 +20,7 @@
#include "rsEnv.h"
#include "rsScript.h"
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
+#if !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
#include "bcinfo/BitcodeTranslator.h"
#endif
@@ -61,11 +61,11 @@ public:
void setupScript(Context *);
void setupGLState(Context *);
private:
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
+#if !defined(RS_COMPATIBILITY_LIB) && !defined(ANDROID_RS_SERIALIZE)
bcinfo::BitcodeTranslator *BT;
#endif
-#if !defined(FAKE_ARM64_BUILD) && !defined(RS_COMPATIBILITY_LIB)
+#if !defined(RS_COMPATIBILITY_LIB)
bool createCacheDir(const char *cacheDir);
#endif
};