[fpc-devel] Case block binary search proposal

2018-08-05 Thread J. Gareth Moreton
 Hi everyone,

 This one has been on my backburner for a while.  I spent the last few
days writing up some theory on the process, and feel this might be a good
optimisation for case blocks whose branches call identically-structured
functions, like in the peephole optimizer and the code formatter in Lazarus
(it hashes individual words then sends it through a large case block, where
a function then determines if it should be made bold or not).
 I've written up my notes on the Wiki over here:
http://wiki.freepascal.org/Case_Compiler_Optimization [1] - I hope it's
explained clearly enough, including the requirements.  At the moment I'm
not personally working on it because I have to finish my work on pure
functions.  Still, how does the proposal look?

 When I do write it, the peephole optimizer will be my main test case, as
it (currently) has 36 branches and I can test its speed and correctness
relatively easily.

 Gareth aka. Kit
  

Links:
--
[1] http://wiki.freepascal.org/Case_Compiler_Optimization
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Case block binary search proposal

2018-08-05 Thread J. Gareth Moreton
 P.S. The Wiki topic isn't just for the binary search proposal, and can
easily be expanded for proposed and existing paradigms, and become an
advanced programming guide. For example, I would be grateful for
documentation on how the jump table system works.

 Gareth aka. Kit

 On Sun 05/08/18 14:38 , "J. Gareth Moreton" gar...@moreton-family.com
sent:
  Hi everyone,

 This one has been on my backburner for a while.  I spent the last few
days writing up some theory on the process, and feel this might be a good
optimisation for case blocks whose branches call identically-structured
functions, like in the peephole optimizer and the code formatter in Lazarus
(it hashes individual words then sends it through a large case block, where
a function then determines if it should be made bold or not).
 I've written up my notes on the Wiki over here:
http://wiki.freepascal.org/Case_Compiler_Optimization [1] - I hope it's
explained clearly enough, including the requirements.  At the moment I'm
not personally working on it because I have to finish my work on pure
functions.  Still, how does the proposal look?

 When I do write it, the peephole optimizer will be my main test case, as
it (currently) has 36 branches and I can test its speed and correctness
relatively easily.

 Gareth aka. Kit
  ___
 fpc-devel maillist - fpc-devel@lists.freepascal.org [2]
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[3]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

 

Links:
--
[1] http://wiki.freepascal.org/Case_Compiler_Optimization
[2] mailto:fpc-devel@lists.freepascal.org
[3] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Adapting MakeFile to make subfolders for targets with sub architectures

2018-08-05 Thread Christo
On Sat, 2018-07-28 at 22:48 +0200, Christo wrote:
> On Thu, 2018-07-26 at 22:19 +0200, Florian Klämpfl wrote:
> > 
> > 
> Well, I got also stuck on the fpmake problem :(
> 
> Yes, it appears to me that fpmkunit lack support for subarch & ABI at the 
> moment, else it
> would
> have been easy to modify TPackage.GetUnitsOutputDir in a similar way.

A patch to implement the idea is available here: 
https://github.com/ccrause/fpc-avr/blob/master/
misc/fpc-subarch-abi-target/target-subarch-abi.patch

General approach: include subarch and (if applicable) ABI in target name.
* In fpcmake.ini 
  * add SUBARCH_ABI_SUFFIX variable
  * append SUBARCH_ABI_SUFFIX variable to FULLTARGET variable to form 
TARGET_SUFFIX variable
* In fpmkunit.pp:
  * add support for new command line options subarch and abi
  * include subarch and abi in MakeTargetString function
* In Makefile.fpc:
  * add --subarch and --abi options to FPC_TARGETOPT variable
  * remove -Cp%, -P%, -T% and -Ca% from FPCOPT variable

TODO - Update fpcmkcfg once approach is accepted.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel