fix broken control flow in ScTokenArray::CheckToken()
Before commit b366adcf5aca this function didn't do anything for unhandled
opcodes, but the commit made the else branch disable vectorization
for "the rest" of opcodes. That meant that basic opcodes such as ocAdd,
which didn't get thrown out by the SC_OPCODE_START_BIN_OP block (since they
are in the allowed subset), ended up in the else block and vectorization
got disabled.
Change-Id: I9eb408b601f48b8d7b5022ec85225d92729cd778
Reviewed-on: https://gerrit.libreoffice.org/55362
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit a5bae14bc3ae4fd1d0bd3bf72c5a6151d1ccf762)
Reviewed-on: https://gerrit.libreoffice.org/55367
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Luboš Luňák <l.lunak@collabora.com>
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 345af57..fa7bcda 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1611,26 +1611,27 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
;
}
}
else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP &&
ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP)
{
SAL_INFO("sc.opencl", "opcode " << formula::FormulaCompiler().GetOpCodeMap(sheet::FormulaLanguage::ENGLISH)->getSymbol(eOp) << " disables vectorisation for formula group");
meVectorState = FormulaVectorDisabledNotInSubSet;
mbOpenCLEnabled = false;
CheckForThreading(eOp);
}
// only when openCL interpreter is not enabled - the assumption is that
// the S/W interpreter blacklist is more strict
else if (SC_OPCODE_START_BIN_OP <= eOp && eOp < SC_OPCODE_STOP_UN_OP &&
ScCalcConfig::isSwInterpreterEnabled() &&
(dynamic_cast<sc::FormulaGroupInterpreterSoftware*>(sc::FormulaGroupInterpreter::getStatic()) != nullptr) &&
ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->end())
{
SAL_INFO("sc.core.formulagroup", "opcode " << formula::FormulaCompiler().GetOpCodeMap(sheet::FormulaLanguage::ENGLISH)->getSymbol(eOp) << " disables S/W interpreter for formula group");
meVectorState = FormulaVectorDisabledNotInSoftwareSubset;
mbOpenCLEnabled = false;
CheckForThreading(eOp);
if (ScInterpreter::GetGlobalConfig().mbOpenCLSubsetOnly &&
ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpOpenCLSubsetOpCodes->end())
{
SAL_INFO("sc.opencl", "opcode " << formula::FormulaCompiler().GetOpCodeMap(sheet::FormulaLanguage::ENGLISH)->getSymbol(eOp) << " disables vectorisation for formula group");
meVectorState = FormulaVectorDisabledNotInSubSet;
mbOpenCLEnabled = false;
CheckForThreading(eOp);
}
// only when openCL interpreter is not enabled - the assumption is that
// the S/W interpreter blacklist is more strict
else if (ScCalcConfig::isSwInterpreterEnabled() &&
(dynamic_cast<sc::FormulaGroupInterpreterSoftware*>(sc::FormulaGroupInterpreter::getStatic()) != nullptr) &&
ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->find(eOp) == ScInterpreter::GetGlobalConfig().mpSwInterpreterSubsetOpCodes->end())
{
SAL_INFO("sc.core.formulagroup", "opcode " << formula::FormulaCompiler().GetOpCodeMap(sheet::FormulaLanguage::ENGLISH)->getSymbol(eOp) << " disables S/W interpreter for formula group");
meVectorState = FormulaVectorDisabledNotInSoftwareSubset;
mbOpenCLEnabled = false;
CheckForThreading(eOp);
}
}
else
{