From e675a66504538079cec95a94fa1220cee5a4161c Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 18 Dec 2017 09:45:36 -0800 Subject: [PATCH] [muparser] Remove some unused "optimized" opcodes --- muparser-2.2.5/include/muParserDef.h | 7 ------- muparser-2.2.5/src/muParserBase.cpp | 19 ------------------- muparser-2.2.5/src/muParserBytecode.cpp | 22 ---------------------- 3 files changed, 48 deletions(-) diff --git a/muparser-2.2.5/include/muParserDef.h b/muparser-2.2.5/include/muParserDef.h index 58cf6c5f9..d4938fcd7 100644 --- a/muparser-2.2.5/include/muParserDef.h +++ b/muparser-2.2.5/include/muParserDef.h @@ -145,13 +145,6 @@ enum ECmdCode { cmVAR = 20, ///< variable item cmVAL = 21, ///< value item - // For optimization purposes - cmVARPOW2, - cmVARPOW3, - cmVARPOW4, - cmVARMUL, - cmPOW2, - // operators and functions cmFUNC, ///< Code for a generic function item cmFUNC_STR, ///< Code for a function with a string parameter diff --git a/muparser-2.2.5/src/muParserBase.cpp b/muparser-2.2.5/src/muParserBase.cpp index c167f2f9f..32f909bf3 100644 --- a/muparser-2.2.5/src/muParserBase.cpp +++ b/muparser-2.2.5/src/muParserBase.cpp @@ -868,25 +868,6 @@ ValueOrError ParserBase::ExecuteRPN() const { Stack[++sidx] = pTok->Val.data2; continue; - case cmVARPOW2: - buf = *(pTok->Val.ptr); - Stack[++sidx] = buf * buf; - continue; - - case cmVARPOW3: - buf = *(pTok->Val.ptr); - Stack[++sidx] = buf * buf * buf; - continue; - - case cmVARPOW4: - buf = *(pTok->Val.ptr); - Stack[++sidx] = buf * buf * buf * buf; - continue; - - case cmVARMUL: - Stack[++sidx] = *(pTok->Val.ptr) * pTok->Val.data + pTok->Val.data2; - continue; - // Next is treatment of numeric functions case cmFUNC: { int iArgCount = pTok->Fun.argc; diff --git a/muparser-2.2.5/src/muParserBytecode.cpp b/muparser-2.2.5/src/muParserBytecode.cpp index f2dd8c0c5..e0f3bd896 100644 --- a/muparser-2.2.5/src/muParserBytecode.cpp +++ b/muparser-2.2.5/src/muParserBytecode.cpp @@ -255,28 +255,6 @@ void ParserByteCode::AsciiDump() { mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]\n"); break; - case cmVARPOW2: - mu::console() << _T("VARPOW2 \t"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]\n"); - break; - - case cmVARPOW3: - mu::console() << _T("VARPOW3 \t"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]\n"); - break; - - case cmVARPOW4: - mu::console() << _T("VARPOW4 \t"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]\n"); - break; - - case cmVARMUL: - mu::console() << _T("VARMUL \t"); - mu::console() << _T("[ADDR: 0x") << std::hex << m_vRPN[i].Val.ptr << _T("]"); - mu::console() << _T(" * [") << m_vRPN[i].Val.data << _T("]"); - mu::console() << _T(" + [") << m_vRPN[i].Val.data2 << _T("]\n"); - break; - case cmFUNC: mu::console() << _T("CALL\t"); mu::console() << _T("[ARG:") << std::dec << m_vRPN[i].Fun.argc << _T("]");