summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/token.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-11-24 11:12:33 +0100
committerJan Holesovsky <kendy@collabora.com>2015-11-24 11:12:33 +0100
commit2fb8894e45770b816e674a7c38e295f1e6673084 (patch)
tree8f833e939b8b193221551f47a123bbc51cb0a84b /sc/source/core/tool/token.cxx
parent626675a2692907ba5363f135c0f67d19ebdc5ff5 (diff)
sc: Implement S/W interpreter subsetting, similarly to openCL one. private/kendy/swinterpreter
And add only the minimum amonut of operations we are sure about. Change-Id: I53b780091bc7b2cc78a3571b072ce00d19971fe8
Diffstat (limited to 'sc/source/core/tool/token.cxx')
-rw-r--r--sc/source/core/tool/token.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 08fcadaad7a6..63ab8faec151 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1315,7 +1315,13 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
if (SC_OPCODE_START_FUNCTION <= eOp && eOp < SC_OPCODE_STOP_FUNCTION)
{
- if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
+ if (ScCalcConfig::isOpenCLEnabled() && ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly && ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
+ {
+ meVectorState = FormulaVectorDisabled;
+ return;
+ }
+
+ if (getenv("SC_ALLOW_SOFTWARE_INTERPRETER") != nullptr && ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->end())
{
meVectorState = FormulaVectorDisabled;
return;
@@ -1555,12 +1561,22 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
if (eOp >= SC_OPCODE_START_BIN_OP &&
eOp <= SC_OPCODE_STOP_UN_OP &&
+ ScCalcConfig::isOpenCLEnabled() &&
ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
{
meVectorState = FormulaVectorDisabled;
return;
}
+
+ if (eOp >= SC_OPCODE_START_BIN_OP &&
+ eOp <= SC_OPCODE_STOP_UN_OP &&
+ getenv("SC_ALLOW_SOFTWARE_INTERPRETER") != nullptr &&
+ ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->end())
+ {
+ meVectorState = FormulaVectorDisabled;
+ return;
+ }
}
bool ScTokenArray::ImplGetReference( ScRange& rRange, const ScAddress& rPos, bool bValidOnly ) const