History | View | Annotate | Download (16.3 kB)
TCG: improve optimizer debugging
Use enum TCGOpcode instead of plain old int so that the name ofcurrent op can be seen in GDB. Add a default case to switchso that GCC does not complain about unhandled enum cases.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg: Constant fold neg, andc, orc, eqv, nand, nor.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg: Always define all of the TCGOpcode enum members.
By always defining these symbols, we can eliminate a lot of ifdefs.
To allow this to be checked reliably, the semantics of theTCG_TARGET_HAS_* macros must be changed from def/undef to true/false.This allows even more ifdefs to be removed, converting them into...
tcg: Add and use TCG_OPF_64BIT.
This allows the simplification of the op_bits function fromtcg/optimize.c.
TCG: fix copy propagation
Copy propagation introduced in 22613af4a6d9602001e6d0e7b6d98aa40aa018dcconsidered only global registers. However, register temps and stackallocated locals must be handled differently because register tempsdon't survive across brcond....
TCG: fix breakage by previous patch
Fix incorrect logic and typos in previous commit1bfd07bdfe56cea43dbe258dcb161e46b0ee29b7.
TCG: fix breakage on some RISC hosts
Fix breakage by a640f03178c22355a158fa9378e4f8bfa4f517a6and 55c0975c5b358e948b9ae7bd7b07eff92508e756.
Some TCG targets don't implement all TCG ops, so makeoptimizing those conditional.
Do constant folding for unary operations.
Perform constant folding for NOT and EXT{8,16,32}{S,U} operations.
Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Do constant folding for boolean operations.
Perform constant folding for AND, OR, XOR operations.
Do constant folding for shift operations.
Perform constant forlding for SHR, SHL, SAR, ROTR, ROTL operations.
Do constant folding for basic arithmetic operations.
Perform actual constant folding for ADD, SUB and MUL operations.
Add copy and constant propagation.
Make tcg_constant_folding do copy and constant propagation. It is apreparational work before actual constant folding.
Add TCG optimizations stub
Added file tcg/optimize.c to hold TCG optimizations. Function tcg_optimizeis called from tcg_gen_code_common. It calls other functions performingspecific optimizations. Stub for constant folding was added.
Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>...