Commit Graph

65 Commits

Author SHA1 Message Date
florian
22956c4393 + TX86AsmOptimizer.OptPass1OP
git-svn-id: trunk@36365 -
2017-05-28 13:49:43 +00:00
florian
c83e6991d5 * properly check number of operands
git-svn-id: trunk@36322 -
2017-05-25 12:44:30 +00:00
yury
884cb758e7 * Ensure the number of operands is 2 for MOVXX instructions in OptPass1MOVXX. Otherwise the classic MOVSD/W/B no-operand instructions (REP MOVSX) cause AV during checks of operands. The AV is thrown when trying to compile ucomplex.pp with -Cfsse3.
* Also fixed generation of debug comments in OptPass1MOVXX.

git-svn-id: trunk@36295 -
2017-05-22 15:20:18 +00:00
florian
3c5ec4e76c * allocate register correctly for "MovMov2Mov 2"
+ more debug messages
* debug message naming fixed

git-svn-id: trunk@36284 -
2017-05-21 15:06:22 +00:00
florian
1ffdf02b94 + Ch_*Op4
+ op_const_reg_reg_reg

git-svn-id: trunk@36279 -
2017-05-21 11:12:55 +00:00
florian
0f16f6d94d + OptPass1MOVXX
git-svn-id: trunk@36209 -
2017-05-14 20:59:10 +00:00
florian
535c990233 + OptPass1MOVAP
git-svn-id: trunk@36203 -
2017-05-13 21:48:44 +00:00
florian
3ade6ae9b8 + Mov2Nop optimization
git-svn-id: trunk@36201 -
2017-05-13 09:58:27 +00:00
florian
f4a29bb75d * moved InstructionLoadsFromReg and RegReadByInstruction from TCpuAsmOptimizer (i386) to TX86AsmOptimizer
git-svn-id: trunk@36200 -
2017-05-13 09:58:25 +00:00
florian
f93b784895 * make fullcycle for i8086 fixed
git-svn-id: trunk@36164 -
2017-05-09 19:53:06 +00:00
florian
52d3756c26 * factored out OptPass1Movx and merged i386 and x86-64 version
git-svn-id: trunk@36159 -
2017-05-08 20:44:27 +00:00
florian
06c4c651fd * factored out PrePeepholeOptSxx
+ x86-64 uses PrePeepholeOptSxx now as well

git-svn-id: trunk@36158 -
2017-05-08 20:44:24 +00:00
florian
74b338266d * ifdef cmov optimization, as i8086 has no cpu_capabilities
git-svn-id: trunk@36150 -
2017-05-07 16:18:44 +00:00
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