[fpc-devel] Kit's ambitions!

J. Gareth Moreton gareth at moreton-family.com
Tue May 15 03:04:54 CEST 2018


 I don't know much about AVR yet, but who knows.  At the moment I'm
researching how inline Pascal procedures are compiled and seeing how it can
be translated into assembler routines. It might end up that I end up
writing a kind of mid-level assembler within the Pascal compiler that
allows the registers to be changed where possible.

 Unless its stability is proven, the Deep Optimizer and the assembly
inliner will be -O4 options, although I would like to get them down to -O3
ideally, especially the Deep Optimizer because that is purely at assembler
level where the registers are no longer virtual, and in most cases, lines
of code are being removed or rearranged rather than added.

 Gareth aka. Kit

 On Mon 14/05/18 18:07 , "Christo Crause" christo.crause at gmail.com sent:
 This sounds great! Perhaps some of your work will trickle down to the AVR
target someday. 
 Best regards, Christo

 On 13 May 2018 10:31 pm, "J. Gareth Moreton"  wrote:
 Thanks for your kind words, Christo. A lot of this is personal research,
but I would like to make some elements work.  For inline support on
assembler routines, I'm going to be rather conservative about what will be
successful - for example, if there exists a CALL operation inside the
routine, I will stop trying to inline it because there's no telling what it
will do to affect the registers.

 For the Deep Optimizer, I've programmed a coloured text output of an
assembled procedure that I will probably make a feature that can be
included with a $DEFINE in the Free Pascal source code, as the intention of
it is to show what the assembled procedure is before it is optimised with
data flow analysis, and then what it is after optimisation.  Alongside
standard hints and warnings, it can easily be adapted to show things that
look suspicious such as an uninitialised register. We'll see.

 Gareth aka. Kit

  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180515/1ae13f14/attachment.html>


More information about the fpc-devel mailing list