Commit Graph

25 Commits

Author SHA1 Message Date
nickysn
0cd70844f1 + take into account the fact that lea doesn't read the segment register of its
reference in i386's TCpuAsmOptimizer.RegReadByInstruction

git-svn-id: trunk@36080 -
2017-05-04 14:13:53 +00:00
nickysn
d5d53e7017 * fixed operand order in the check for sse movsd in i386's
TCpuAsmOptimizer.RegReadByInstruction

git-svn-id: trunk@36003 -
2017-04-28 14:56:54 +00:00
nickysn
ff1ee6836d + fix RegReadByInstruction for the x86 MOVSD instruction
git-svn-id: trunk@35968 -
2017-04-27 14:42:08 +00:00
nickysn
b741e38f98 + precise handling for x86 conditions and their flag bits in i386's
TCpuAsmOptimizer.RegReadByInstruction

git-svn-id: trunk@35965 -
2017-04-27 12:07:48 +00:00
nickysn
0f010430cc + better precision in determining the registers, read by mul/imul/div/idiv in
i386's TCpuAsmOptimizer.RegReadByInstruction:
  * mul doesn't read edx (unless included in operand)
  * 8-bit mul and imul don't read ah (unless included in operand)
  * 8-bit div and idiv don't read edx (unless included in operand)

git-svn-id: trunk@35958 -
2017-04-26 16:17:31 +00:00
nickysn
916c09af55 + also check the register type when checking for specific integer registers in
i386's TCpuAsmOptimizer.RegReadByInstruction. Previously, the lack of this
  check could generate false reads on some other register types (e.g. mmx/xmm/
  flags, etc.), and this could worsen optimizations.

git-svn-id: trunk@35957 -
2017-04-26 15:25:38 +00:00
nickysn
618b6292ee + support testing for individual bits from the x86 flags register in i386's
TCpuAsmOptimizer.RegReadByInstruction()

git-svn-id: trunk@35956 -
2017-04-26 14:38:36 +00:00
nickysn
1d34e96064 + added x86 instruction flag Ch_RFLAGScc, indicating instructions that read
specific bits from the flags register, according to their condition (used by
  Jcc/SETcc/CMOVcc)

git-svn-id: trunk@35907 -
2017-04-22 22:07:05 +00:00
nickysn
1146b7c12c + added detailed information for individual flag bits use for most x86
instructions. Not used by the compiler yet, but may allow more
  optimizations in the future.

git-svn-id: trunk@35882 -
2017-04-21 23:03:33 +00:00
nickysn
869f395a31 + added knowledge to the compiler for the x86 instructions, that don't read
their input registers, in case both parameters are the same register (e.g.
  xor eax, eax; sub eax, eax; etc.)

git-svn-id: trunk@35861 -
2017-04-20 15:11:56 +00:00
nickysn
9303a8f61a * changed the x86 TInsProp.Ch structure from a 3-element array to a pascal set;
this removes the limit of 3 Ch_XXX flags per instruction (thus allowing adding
  more precise flags, e.g. for tracking only certain bits of the flags register,
  etc.) and avoids the ugliness of having the Ch_None filler, which makes
  x86ins.dat less readable.

git-svn-id: trunk@35850 -
2017-04-19 16:48:35 +00:00
florian
f68558b88c * factored out TX86AsmOptimizer.OptPass2Imul
git-svn-id: trunk@35252 -
2017-01-06 22:25:24 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
yury
649823a246 * Removed unused vars.
git-svn-id: trunk@34405 -
2016-09-01 20:01:54 +00:00
florian
7f44774852 * i386 uses OptPass1And from aoptx86
git-svn-id: trunk@33936 -
2016-06-07 20:01:13 +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
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
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
f0e75de730 * properly update allocation info of the involved register when carrying out an MovMovCmp2MovCmp optimization, resolves issue #30052
* few changed to make code more readable

git-svn-id: trunk@33551 -
2016-04-24 15:57:06 +00:00
florian
8d9f6bbe0b * disable some debugging code which does not work anymore due to the unification of the peephole optimizer
git-svn-id: trunk@33546 -
2016-04-22 20:31:25 +00:00
florian
77b4709e7a + i386 compiler tracks now flag usage if needed, so the mov $0,reg -> xor reg,reg transformation can be enabled
git-svn-id: trunk@33545 -
2016-04-22 19:44:26 +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