<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi everyone,</p>
<p>So after my x86_64 optimizer overhaul was rejected in its current
form, I decided to set to work again in cleaner steps. The first
thing I've started to address are jump optimisations, since they
gave notable improvements that were independent of things lke the
reduction in the number of passes. There is also a bonus... a lot
of it is cross-platform too!</p>
<p>One thing I do need to do is to cross-compile to all known
platforms... I can only test a handful of the i386 and x86_64
platforms, but I want to at least see if it compiles before I
submit the patch for more thorough testing. Does anyone have any
tips or a sample script (preferably a .BAT file) that
cross-compiles from x86_64-win64 or i386-win32 onto a reasonable
set of platforms that at least gives me a good smoke test?
(Obviously, every combination is a little overkill if
impractical).</p>
<p>I'm trying to keep things as simple as possible, but for the best
optimisations, I had to introduce a new function for all
platforms:</p>
<p><b>function </b>condition_in(<b>const </b>c1, c2: TAsmCond):
Boolean;</p>
<p>It is similar to "conditions_equal", but it returns true if c1 is
a subset of c2 (e.g. "C_E" and "C_L" are both subsets of "C_LE",
but "C_LE" is not a subset of "C_L"). It always returns True if
c2 is "C_None" (i.e. an unconditional jump) or if the conditions
are equal, but analysing the subsets is platform-specific. I've
done the best I can for the platform-specific assemblers that I
don't know too well, but I'll need someone to check them over and
maybe improve them, since I don't know what some of the conditions
are. The function is mostly failsafe, in that if it returns
False, an optimisation won't be performed. It's to help track
final jump destinations more accurately, as well as detect what I
call 'dominated jumps' - for example:</p>
<p>jbe @lbl1<br>
je @lbl2</p>
<p>The je instruction will never branch because the jbe instruction
above it will branch if the equality condition is met, so it can
be safely removed.</p>
<p>I'll run the win32 and win64 tests over Thursday and will submit
the patches once everything passes, as well as a PDF design and
implementation spec to explain what everything is as well as the
concepts of dominated jumps and the like.<br>
</p>
<p>Gareth aka. Kit<br>
</p>
</body>
</html>