diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2018-06-06 09:37:23 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2018-06-06 12:33:14 +0200 |
commit | a5bae14bc3ae4fd1d0bd3bf72c5a6151d1ccf762 (patch) | |
tree | 6b7231232f40be08ae707b3b785710f485dac7e4 | |
parent | 377cb34ac023096af7f1708c3d4ea5293d4cc7ab (diff) |
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>
-rw-r--r-- | sc/source/core/tool/token.cxx | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 8f2330f0cb2e..000e537b65b8 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1612,26 +1612,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 { |