Hi everyone,

While I'm starting to focus more on node-level optimisations, since they benefit more platforms and can produce better optimisations in some situations due to cross-platform support and things like register allocation, I'm thinking about refactoring and improving x86's OptPass1MOV routine for the following main reasons:

 * It has become a massive, monolithic Frankenstein's monster of an
   optmisation routine with lots of different optimisations and styles
   of optimisation that are a little difficult to track sometimes (this
   is partly a given though since about 25% of all x86 assembly
   language consists of a MOV instruction).  Some refactoring will make
   it more maintainable and potentially faster and smaller.
 * It's not as neat and far-reaching as, say, the equivalent routine
   for the AArch64 peephole optimizer, which utilises
   GetNextInstructionUsingReg that can produce more long-range
   optimisations under -O3.

In other news, pure functions are still waiting for some third-party testing although I've fixed a couple of bugs in the interim.  Currently, the main sticking point are that floating-point values are not being propagated (pure function analysis utilises constant propagation, deadstore removal and in-depth node optimisation to calculate output values).  Making a patch to enable this has revealed some shortcomings, notably how programs and tests behave when floating-point exceptions are enabled (operations where deterministic values are divided by zero are being replaced with constants equalling infinity instead of raising an exception) and also some inconsistent behaviour across platforms where the Currency type is concerned.  Nevertheless, things are coming together.

Kit
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to