Commit Graph

102 Commits

Author SHA1 Message Date
florian
f8d517be70 * make TX86AsmOptimizer.IsExitCode usable for x86-64 as well
git-svn-id: trunk@36148 -
2017-05-07 16:18:40 +00:00
florian
4a43d992f5 * unified usage of MatchOpType
* fixed generic MatchOpType

git-svn-id: trunk@36145 -
2017-05-07 16:18:33 +00:00
florian
7afe762d22 * factored out OptPass2Jcc assembler optimization
* OptPass2Jcc now used by x86-64 as well
* remove orphaned alignments if the label is not used anymore after cmov is used

git-svn-id: trunk@36143 -
2017-05-07 12:45:48 +00:00
florian
e3f0b338d4 * SkipLabels moved to aoptutils
* factored out OptPass2Jmp assembler optimization
* OptPass2Jmp now used by x86-64 as well

git-svn-id: trunk@36141 -
2017-05-06 21:07:02 +00:00
florian
f985971a62 * apply mov reg1, mem1; cmp x, mem1 to mov reg1, mem1; cmp x, reg1 also for test
git-svn-id: trunk@36138 -
2017-05-06 18:47:47 +00:00
nickysn
b882ba5fd2 + also recognize sbb reg,reg as writing a new value in the register in TX86AsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@36119 -
2017-05-05 14:24:13 +00:00
nickysn
0e0e5c0caf + support the flags register and its subregisters in TX86AsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@36114 -
2017-05-05 12:17:50 +00:00
nickysn
85fbbec319 + recognize xor reg,reg (same register twice) and sub reg,reg as writing a new
value to reg in TX86AsmOptimizer.RegLoadedWithNewValue

git-svn-id: trunk@36112 -
2017-05-05 11:01:34 +00:00
nickysn
aa93259463 + support the lahf,fstsw and fnstsw instructions in
TX86AsmOptimizer.RegLoadedWithNewValue

git-svn-id: trunk@36087 -
2017-05-04 16:02:01 +00:00
nickysn
92cc447326 + support the aam instruction in TX86AsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@36083 -
2017-05-04 15:34:48 +00:00
nickysn
2431b1fa19 + support the lodsb,lodsw,lodsd and lodsq instructions in
TX86AsmOptimizer.RegLoadedWithNewValue

git-svn-id: trunk@36082 -
2017-05-04 15:12:37 +00:00
nickysn
6b7593d7d0 + support the SETcc instructions in TX86AsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@36081 -
2017-05-04 14:43:18 +00:00
nickysn
e10f184b74 + support lds,les,lfs,lgs and lss in TX86AsmOptimizer.RegLoadedWithNewValue
git-svn-id: trunk@36079 -
2017-05-04 14:08:36 +00:00
nickysn
eac74f5a81 + support the cwd,cdq,cqo and cbw instructions in
TX86AsmOptimizer.RegLoadedWithNewValue (cwde and cdqe don't need special
  support)

git-svn-id: trunk@36077 -
2017-05-04 12:15:40 +00:00
nickysn
1a139b951d + properly support the one operand version of imul and mul in
TX86AsmOptimizer.RegLoadedWithNewValue

git-svn-id: trunk@36068 -
2017-05-03 15:07:21 +00:00
nickysn
65960048c8 * fixed TX86AsmOptimizer.RegLoadedWithNewValue for 3-operand imul, where the
second operand is a memory reference

git-svn-id: trunk@36067 -
2017-05-03 13:43:16 +00:00
nickysn
1f5aec6d3d + make use of the Reg1WriteOverwritesReg2Entirely and Reg1ReadDependsOnReg2
instead of SuperRegistersEqual in TX86AsmOptimizer.RegLoadedWithNewValue, so
  it returns correct information for the 16-bit and 8-bit subregisters
  (including AH,BH,CH and DH)

git-svn-id: trunk@36066 -
2017-05-03 12:14:30 +00:00
nickysn
66c350d8d2 * fixed access violation bug in TX86AsmOptimizer.RegLoadedWithNewValue for the
A_MOVSD string instruction

git-svn-id: trunk@35995 -
2017-04-28 13:09:27 +00:00
nickysn
e6e55b3004 + added function TX86AsmOptimizer.Reg1ReadDependsOnReg2, which checks whether
two registers are independent (taking into account AH vs AL)

git-svn-id: trunk@35991 -
2017-04-28 09:24:48 +00:00
nickysn
33f9b36a54 + added and implemented function TX86AsmOptimizer.Reg1WriteOverwritesReg2Entirely,
which takes into account how 16-bit and 8-bit subregisters work on the x86
  (the new function is not used for now, but is probably going to replace
  SuperRegistersEqual in a few specific places (in RegLoadedWithNewValue),
  so that our register tracking becomes more accurate for 8-bit and 16-bit
  subregisters)

git-svn-id: trunk@35990 -
2017-04-27 22:30:47 +00:00
yury
94a65e99f1 * Removed unused var.
git-svn-id: trunk@35546 -
2017-03-09 13:49:46 +00:00
florian
f68558b88c * factored out TX86AsmOptimizer.OptPass2Imul
git-svn-id: trunk@35252 -
2017-01-06 22:25:24 +00:00
florian
ebb2b81f79 * FoldLea optimizes more cases
git-svn-id: trunk@35251 -
2017-01-06 22:25:22 +00:00
florian
781d6f31a8 * more getsupreg(...)<>/=getsupreg(...) replaced by SuperRegisterEqual which is more safe, the former could break as the register could have different register types
git-svn-id: trunk@34746 -
2016-10-20 18:32:23 +00:00
florian
cf2a3d8160 + new debug message
* turn off accidently turned on DEBUG_AOPTCPU

git-svn-id: trunk@34731 -
2016-10-16 16:37:51 +00:00
florian
fe0ce2f456 * TX86AsmOptimizer.OptPass1MOV should be left, after an optimization has been carried out, instead the outer loop should call it again, resolves issue #30277
git-svn-id: trunk@34724 -
2016-10-15 19:36:18 +00:00
florian
239c6639d7 + additional debug message
git-svn-id: trunk@34722 -
2016-10-15 17:51:09 +00:00
florian
76961dbc70 * fixes MovOpMov2Op
git-svn-id: trunk@34721 -
2016-10-15 15:03:27 +00:00
florian
8e9f4af801 * fixed checking of operands of MovOpMov2Op
* MovOpMov2Op optimization got proper naming

git-svn-id: trunk@34719 -
2016-10-15 15:03:24 +00:00
florian
4109f88e08 * AllocRegBetween always extends the processed register to the whole super register and takes care of this while removing (de)/allocs
git-svn-id: trunk@34718 -
2016-10-15 15:03:23 +00:00
florian
57ca8647b3 * better peephole optimization tracing
git-svn-id: trunk@34698 -
2016-10-09 13:41:38 +00:00
Jeppe Johansen
348c373e9f Fixed two bugs in the x86 peephole optimizer.
git-svn-id: trunk@34497 -
2016-09-10 19:13:48 +00:00
florian
d31d24ed16 * r33995 was not complete
git-svn-id: trunk@33997 -
2016-06-16 19:26:43 +00:00
florian
1cbae41cab * proper fix for the issue detected in r33945
git-svn-id: trunk@33995 -
2016-06-15 20:43:52 +00:00
florian
2890927b10 * MovMov2MovMov1 requires that the allocation of the first register is extended
git-svn-id: trunk@33948 -
2016-06-11 19:54:18 +00:00
Jonas Maebe
cf6c7a0a1d * missing instruction type check
git-svn-id: trunk@33945 -
2016-06-10 17:59:18 +00:00
florian
7f44774852 * i386 uses OptPass1And from aoptx86
git-svn-id: trunk@33936 -
2016-06-07 20:01:13 +00:00
florian
ff506eb219 * enabled And2Test optimization
git-svn-id: trunk@33935 -
2016-06-07 20:01:11 +00:00
florian
a5fc8b629a * factored out OptPass1AND from x86-64 and moved it to aoptx86
git-svn-id: trunk@33934 -
2016-06-07 20:01:09 +00:00
florian
5e8e21c1be * factored out OpPass2MOV code, x86-64 uses it as well now
git-svn-id: trunk@33932 -
2016-06-06 21:18:24 +00:00
florian
6609e8def2 * correctly set the size of the operation when carrying out Mov Op Mov optimizations
git-svn-id: trunk@33930 -
2016-06-06 21:18:21 +00:00
florian
b274599a47 * made some assembler optimizer methods class methods
git-svn-id: trunk@33929 -
2016-06-06 21:18:20 +00:00
florian
e56147ac6e * integrated mov op mov -> op optimization in aoptx86
* isFoldableArithOp is in aoptx86 now

git-svn-id: trunk@33928 -
2016-06-06 21:18:18 +00:00
florian
9ed6638baa * moved MovAnd2Mov optimization to aoptx86
git-svn-id: trunk@33927 -
2016-06-06 21:18:16 +00:00
florian
dfe41db13f * call GetNextInstruction only once when carrying out mov optimizations
git-svn-id: trunk@33916 -
2016-06-05 12:40:41 +00:00
florian
ba54f7243e * moved all i386 mov peephole optimization code into OptPass1MOV
git-svn-id: trunk@33908 -
2016-06-04 19:34:18 +00:00
florian
20807f4148 * factored out V<Op> optimizations into OptPass1VOP
* call OptPass1VOP also for i386

git-svn-id: trunk@33878 -
2016-06-01 20:49:35 +00:00
florian
bd54a11f1c + TX86AsmOptimizer.OptPass1VMOVAP for i386 and x86-64
+ new unit aoptutils which helpers for the assembler optimizer

git-svn-id: trunk@33587 -
2016-05-01 09:37:21 +00:00
florian
ec92bc3390 * case of identifiers fixed
* x86-64 uses also the mov $0,... -> xor optimization

git-svn-id: trunk@33553 -
2016-04-24 20:01:43 +00:00
florian
3c2dab9878 * i386 peephole assembler uses largely the common peephole optimizer infrastructure, the resulting code is besides a few improvements the same
git-svn-id: trunk@33542 -
2016-04-21 20:14:01 +00:00
florian
c40240990e * popt386 uses now also all routines of aoptx86
git-svn-id: trunk@31894 -
2015-09-29 19:31:33 +00:00
florian
53ea4fb7d4 * unify x86 peephole optimizer helpers
git-svn-id: trunk@31843 -
2015-09-27 09:36:39 +00:00