Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension of bin2llvmir with optimization of X87 FPU stack. #715

Merged
merged 110 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
28ccac1
capstone2llvmir/x86: Add support of x87 FISTPP instruction and unit t…
JurajHolub Aug 23, 2019
d507fba
capstone2llvmir/x86: Add support of x87 FCMOVEcc instructions and uni…
JurajHolub Aug 31, 2019
701c661
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
0efe91a
capstone2llvmir/x86: Add tests for x87 FPREM instructions.
JurajHolub Aug 31, 2019
fef24e5
capstone2llvmir/x86: Add support of x87 F2XM1, FYL2X, FYL2xP1 instruc…
JurajHolub Sep 3, 2019
1d522ac
capstone2llvmir/x86: Add support of x87 FFREE instructions and unit t…
JurajHolub Sep 4, 2019
3dd9ca6
capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit …
JurajHolub Sep 4, 2019
4859af8
bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and f…
JurajHolub Sep 9, 2019
15af108
bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.
JurajHolub Sep 9, 2019
e683ee7
capstone2llvmir/x86.cpp: remove extra new lines
PeterMatula Sep 11, 2019
adee5c6
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
21997de
capstone2llvmir/x86: Fix indention of new tests + comments.
JurajHolub Sep 12, 2019
b9d7e44
bin2llvmir/optimizations/x87_fpu: Create tests for different calling …
JurajHolub Sep 12, 2019
cc2aa2d
capstone2llvmir/x86: Unit tests and translation of all FPU capstone i…
JurajHolub Sep 17, 2019
4f4f626
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
55899e1
Merge branch 'master' into x87_fpu_analysis
JurajHolub Sep 18, 2019
8963b7d
config: Include "watcom" calling convention.
JurajHolub Sep 24, 2019
c9beb9d
bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.
JurajHolub Sep 24, 2019
aa32882
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions …
JurajHolub Sep 24, 2019
291c55f
bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage …
JurajHolub Sep 28, 2019
13adddf
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blo…
JurajHolub Sep 30, 2019
d4efe2e
bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.
JurajHolub Sep 30, 2019
cb86706
bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of…
JurajHolub Oct 22, 2019
c375846
bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented fo…
JurajHolub Oct 22, 2019
537691f
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
ec68227
capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit …
JurajHolub Sep 4, 2019
4fc1c05
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
60b8252
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
b3d7cf0
Merge branch 'master' into x87_fpu_analysis
JurajHolub Jan 29, 2020
0201f2b
deps/eigen: Include third party library Eigen to cmake of project. Li…
JurajHolub Feb 3, 2020
1fd9073
bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen …
JurajHolub Feb 3, 2020
be2bccf
tests/bin2llvmir: Refactor CMakeLists.txt
JurajHolub Feb 3, 2020
a9879e7
bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling conven…
JurajHolub Feb 8, 2020
6d42194
bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimizat…
JurajHolub Feb 19, 2020
73c6728
bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined lin…
JurajHolub Feb 19, 2020
39c24d3
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
3f54011
capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit …
JurajHolub Sep 4, 2019
5620549
bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and f…
JurajHolub Sep 9, 2019
111c952
bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.
JurajHolub Sep 9, 2019
3a953ab
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
ac1c053
bin2llvmir/optimizations/x87_fpu: Create tests for different calling …
JurajHolub Sep 12, 2019
c6d17e0
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
8de8460
bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.
JurajHolub Sep 24, 2019
11c14d4
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions …
JurajHolub Sep 24, 2019
117d0b9
bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage …
JurajHolub Sep 28, 2019
d351ef8
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blo…
JurajHolub Sep 30, 2019
4082a3c
bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.
JurajHolub Sep 30, 2019
798b2c6
bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of…
JurajHolub Oct 22, 2019
c1ee4b5
bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented fo…
JurajHolub Oct 22, 2019
29c0a18
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
32bb195
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
e503a8a
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
1a99125
deps/eigen: Include third party library Eigen to cmake of project. Li…
JurajHolub Feb 3, 2020
5b8c593
bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen …
JurajHolub Feb 3, 2020
6319379
tests/bin2llvmir: Refactor CMakeLists.txt
JurajHolub Feb 3, 2020
5b59804
bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling conven…
JurajHolub Feb 8, 2020
453e893
bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimizat…
JurajHolub Feb 19, 2020
9b9f69b
bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined lin…
JurajHolub Feb 19, 2020
600b87a
Merge remote-tracking branch 'origin/x87_fpu_analysis' into x87_fpu_a…
JurajHolub Feb 19, 2020
e288168
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
6960703
capstone2llvmir/x86: Add support of x87 FNSTCW instructions and unit …
JurajHolub Sep 4, 2019
0600fb3
bin2llvmir/optimizations/x87_fpu: Add test for x87 fpu analysis and f…
JurajHolub Sep 9, 2019
73d71fb
bin2llvmir/optimizations/x87_fpu: Fix test for x87 fpu analysis.
JurajHolub Sep 9, 2019
d7500ef
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
2379b9e
bin2llvmir/optimizations/x87_fpu: Create tests for different calling …
JurajHolub Sep 12, 2019
70ea0e4
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
00cbc4c
bin2llvmir/optimizations/x87_fpu: Tests for x87 FPU analyze.
JurajHolub Sep 24, 2019
b623069
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for functions …
JurajHolub Sep 24, 2019
a9238f6
bin2llvmir/optimizations/x87_fpu: Tests for FPU register stack usage …
JurajHolub Sep 28, 2019
7e2c210
bin2llvmir/optimizations/x87_fpu: Analyze of FPU stack for nested blo…
JurajHolub Sep 30, 2019
3dd7cfe
bin2llvmir/optimizations/x87_fpu: Fix nested blocks analyze tests.
JurajHolub Sep 30, 2019
448fa14
bin2llvmir/optimizations/x87_fpu: Implement linear equation solver of…
JurajHolub Oct 22, 2019
f86d61f
bin2llvmir/optimizations/x87_fpu: FPU TOP optimization implemented fo…
JurajHolub Oct 22, 2019
bfb09d1
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
8309b66
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
a34c8fa
capstone2llvmir/x86: Fix bug in FXRSTOR unit etst.
JurajHolub Sep 17, 2019
3f31ebe
deps/eigen: Include third party library Eigen to cmake of project. Li…
JurajHolub Feb 3, 2020
a6f1869
bin2llvmir/optimization/x87_fpu: Rewrite optimization with new Eigen …
JurajHolub Feb 3, 2020
37e5fa1
tests/bin2llvmir: Refactor CMakeLists.txt
JurajHolub Feb 3, 2020
01f5c9e
bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling conven…
JurajHolub Feb 8, 2020
1046cd5
bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimizat…
JurajHolub Feb 19, 2020
69e27b7
bin2llvmir/optimizations/x87_fpu: Fix major bug of overdetermined lin…
JurajHolub Feb 19, 2020
b3f2cc2
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
e277138
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
cb42ca1
bin2llvmir/optimizations/x87_fpu: Create tests for different calling …
JurajHolub Sep 12, 2019
89fad4f
capstone2llvmir/x86: Add support of x87 FPREM instructions and unit t…
JurajHolub Aug 31, 2019
614da9d
capstone2llvmir/x86_impl.h: remove extra newline & indent
PeterMatula Sep 11, 2019
f1bfe04
bin2llvmir/optimization/x87_fpu: Fix bux for X86-16bit calling conven…
JurajHolub Feb 8, 2020
0d8eb65
bin2llvmir/optimizations/x87_fpu: Fix and improve FPU stack optimizat…
JurajHolub Feb 19, 2020
ecc7fd2
src/capstone2llvmir/x86: Fix and remove duplicities caused by my inco…
JurajHolub Feb 24, 2020
8dc8d65
src/bin2llvmir/x87_fpu: Fix bug - remove forgotten declaration.
JurajHolub Feb 24, 2020
08c4d19
src/bin2llvmir/x87_fpu: Fix bug - make analyze more accurate: fix som…
JurajHolub Feb 26, 2020
9286671
tests/bin2llvmir/optimizations/x87_fpu: Rewrite actual and include ne…
JurajHolub Mar 4, 2020
a79edaa
src/bin2llvmir/optimizations/x87_fpu: Fix bugs revealed by integratio…
JurajHolub Mar 4, 2020
65f63a5
Merge remote-tracking branch 'origin/x87_fpu_analysis' into x87_fpu_a…
JurajHolub Mar 4, 2020
fa3468a
src/capstoce2llvmir/x86: Fix merge conflict.
JurajHolub Mar 4, 2020
0391552
deps/eigen: Remove Eigen library from deps and moves it into external…
JurajHolub Mar 31, 2020
e70d143
tests/bin2llvmir/optimizations/x87_fpu: Remove tests to 16bit archite…
JurajHolub Apr 1, 2020
bc097dc
src/bin2llvmir/optimizations/x87_fpu: Improve and optimize performanc…
JurajHolub Apr 1, 2020
ea2c64e
Merge branch 'master' into x87_fpu_analysis
JurajHolub Apr 1, 2020
c79dceb
bin2llvmir/optimization/x87_fpu: Set max performance ceil.
JurajHolub Apr 23, 2020
60c0ce0
Merge branch 'master' of https://github.com/avast/retdec into x87_exp…
JurajHolub Apr 25, 2020
208bcbf
Add External Eigen to cmake/deps.
JurajHolub Apr 25, 2020
4a68a7f
deps/eigen: Update CMake build.
JurajHolub Apr 25, 2020
0f83fd0
deps/eigen: Update CMake build.
JurajHolub Apr 25, 2020
4788944
bin2llvmir/x87_fpu: Update analyze and tests -> remove FPU TAGS becau…
JurajHolub Apr 25, 2020
db3137b
Merge branch 'master' of https://github.com/avast/retdec into x87-exp…
JurajHolub May 2, 2020
6e7831d
deps/eigen: Fix eigen INTERFACE_INCLUDE_DIRECTORIES which was prefixe…
JurajHolub May 2, 2020
5e65cfc
Merge remote-tracking branch 'origin/x87_fpu_analysis' into x87_fpu_a…
JurajHolub May 5, 2020
69bf9da
Merge branch 'master' into x87_fpu_analysis
PeterMatula May 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions LICENSE-THIRD-PARTY
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RetDec uses the following third-party libraries or other resources:
9) whereami: https://github.com/gpakosz/whereami
10) yara: https://virustotal.github.io/yara/
11) yaramod: https://github.com/avast/yaramod
12) Eigen: http://eigen.tuxfamily.org/index.php?title=Main_Page

These third-party libraries or other resources are licensed under the
following licenses:
Expand Down Expand Up @@ -794,3 +795,36 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

===============================================================================
12) Eigen
===============================================================================

Eigen is Free Software. Starting from the 3.1.1 version, it is licensed under
the MPL2, which is a simple weak copyleft license. Common questions about the
MPL2 are answered in the official MPL2 FAQ.

Earlier versions were licensed under the LGPL3+.

Note that currently, a few features rely on third-party code licensed under the
LGPL: SimplicialCholesky, AMD ordering, and constrained_cg. Such features can
be explicitly disabled by compiling with the EIGEN_MPL2_ONLY preprocessor symbol
defined. Furthermore, Eigen provides interface classes for various third-party
libraries (usually recognizable by the <Eigen/*Support> header name). Of course
you have to mind the license of the so-included library when using them.

Virtually any software may use Eigen. For example, closed-source software may use
Eigen without having to disclose its own source code. Many proprietary and
closed-source software projects are using Eigen right now, as well as many
BSD-licensed projects.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ set_if_at_least_one_set(RETDEC_ENABLE_RAPIDJSON
RETDEC_ENABLE_MACHO_EXTRACTORTOOL
RETDEC_ENABLE_SERDES)

set_if_at_least_one_set(RETDEC_ENABLE_EIGEN
RETDEC_ENABLE_BIN2LLVMIR)

set_if_at_least_one_set(RETDEC_ENABLE_TINYXML2
RETDEC_ENABLE_TINYXML2
RETDEC_ENABLE_FILEINFO)
Expand Down
1 change: 1 addition & 0 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ cond_add_subdirectory(tinyxml2 RETDEC_ENABLE_TINYXML2)
cond_add_subdirectory(whereami RETDEC_ENABLE_WHEREAMI)
cond_add_subdirectory(yara RETDEC_ENABLE_YARA)
cond_add_subdirectory(yaramod RETDEC_ENABLE_YARAMOD)
cond_add_subdirectory(eigen RETDEC_ENABLE_EIGEN)
11 changes: 11 additions & 0 deletions deps/eigen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

add_library(eigen INTERFACE)
target_include_directories(eigen
SYSTEM INTERFACE
${CMAKE_CURRENT_LIST_DIR}/include
)
target_compile_definitions(eigen
INTERFACE
EIGNEN_HAS_STDSTRING=1
EIGNEN_HAS_CXX11_RVALUE_REFS=1
)
8 changes: 8 additions & 0 deletions deps/eigen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Eigen

A clone of only the needed sources (headers) of [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so we don't forget: We should discuss with @PeterMatula whether it would be possible to use an external project and download the sources of Eigen when building RetDec so we don't need to have all the 3rd-party sources in our repo. We do this for many of our dependencies.

Upstream commit: `6601abce868e3284b4829a4fbf91eefaa0d704af`

## License

Eigen is [Free Software](http://www.gnu.org/philosophy/free-sw.html). Starting from the 3.1.1 version, it is licensed under the [MPL2](http://www.mozilla.org/MPL/2.0), which is a simple weak copyleft license. Common questions about the MPL2 are answered in the official [MPL2 FAQ](http://www.mozilla.org/MPL/2.0/FAQ.html).
46 changes: 46 additions & 0 deletions deps/eigen/include/Eigen/Cholesky
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_CHOLESKY_MODULE_H
#define EIGEN_CHOLESKY_MODULE_H

#include "Core"
#include "Jacobi"

#include "src/Core/util/DisableStupidWarnings.h"

/** \defgroup Cholesky_Module Cholesky module
*
*
*
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
* Those decompositions are also accessible via the following methods:
* - MatrixBase::llt()
* - MatrixBase::ldlt()
* - SelfAdjointView::llt()
* - SelfAdjointView::ldlt()
*
* \code
* #include <Eigen/Cholesky>
* \endcode
*/

#include "src/Cholesky/LLT.h"
#include "src/Cholesky/LDLT.h"
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
#include "mkl_lapacke.h"
#else
#include "src/misc/lapacke.h"
#endif
#include "src/Cholesky/LLT_LAPACKE.h"
#endif

#include "src/Core/util/ReenableStupidWarnings.h"

#endif // EIGEN_CHOLESKY_MODULE_H
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
48 changes: 48 additions & 0 deletions deps/eigen/include/Eigen/CholmodSupport
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H
#define EIGEN_CHOLMODSUPPORT_MODULE_H

#include "SparseCore"

#include "src/Core/util/DisableStupidWarnings.h"

extern "C" {
#include <cholmod.h>
}

/** \ingroup Support_modules
* \defgroup CholmodSupport_Module CholmodSupport module
*
* This module provides an interface to the Cholmod library which is part of the <a href="http://www.suitesparse.com">suitesparse</a> package.
* It provides the two following main factorization classes:
* - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization.
* - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial).
*
* For the sake of completeness, this module also propose the two following classes:
* - class CholmodSimplicialLLT
* - class CholmodSimplicialLDLT
* Note that these classes does not bring any particular advantage compared to the built-in
* SimplicialLLT and SimplicialLDLT factorization classes.
*
* \code
* #include <Eigen/CholmodSupport>
* \endcode
*
* In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies.
* The dependencies depend on how cholmod has been compiled.
* For a cmake based project, you can use our FindCholmod.cmake module to help you in this task.
*
*/

#include "src/CholmodSupport/CholmodSupport.h"

#include "src/Core/util/ReenableStupidWarnings.h"

#endif // EIGEN_CHOLMODSUPPORT_MODULE_H

Loading