[fpc-devel] State of i8086 generation?
Nikolay Nikolov
nickysn at users.sourceforge.net
Sat Nov 30 00:45:19 CET 2013
On 11/30/2013 12:33 AM, Jim Leonard wrote:
> On 11/29/2013 3:45 PM, Nikolay Nikolov wrote:
>> It should be functional, although it does break occasionally, so you
>> should always keep the latest working version if you plan on using it. I
>> run the testsuite weekly and try to fix any regressions, but
>> occasionally it may take longer if I'm busy. There's a wiki page
>> dedicated to the i8086 port here with more details:
>>
>> http://wiki.freepascal.org/DOS
>
> Thanks, I look forward to playing with this. I'm curious if the
> optimizations in FPC beat those in TP (my guess is very likely, since
> the optimizations in TP were only those that could be implemented in a
> single pass, with no peephole optimization).
Note that right now FPC is still usually slower than TP, mainly because
TP's RTL is written mostly in optimized asm, while the FPC RTL is mostly
written in pascal. But, of course, you can always help with patches :)
Also, there's still no peephole optimizer for i8086 (there's a jump
optimizer, though) and regvars don't yet work (they produce wrong code
for a reason I've not discovered yet, so they're disabled from -O2. They
also cause problems with the register allocator). But eventually, in the
long run, FPC should be able to produce much better code than TP.
However, I'm still not done with all the memory models yet, so I'm still
focusing mostly on testing for correctness, getting more code to
compile, fixing bugs, etc. and not so much on optimization. Getting the
medium memory model to work was much harder than I expected and I expect
that large & compact will be even harder (although, the good part is
that we'll probably get both of them working at the same time, since the
actual new feature is support for far data; far code is already
supported), so my current plan is this:
1) get as much code working under the medium memory model, e.g. get free
vision working
2) improve the far pointer support, until it becomes stable enough to be
the default pointer type, so we can start the large & compact memory models
3) get the large & compact memory models working and stabilize them
If I'm the only person working on the i8086 port, I'm guessing this will
take anything between 6 months to a year, so I'll probably not have much
time to work on the optimizer. But then, again, I may get distracted
while trying to get something to work and do some work on optimization,
so I can get it working fast enough on a vintage machine or to get
something to fit in 64kb.
Another distraction I currently have is fixing the 8087 support, since I
got one from eBay and installed it on my IBM 5150. The bad thing about
8087, though, is the fact that we cannot easily run automated tests on
it. Normally, I run the FPC testsuite with dosbox, which emulates a 387+.
Nikolay
More information about the fpc-devel
mailing list