Re: [fpc-devel] Case block optimisation

2018-12-30 Thread J. Gareth Moreton
So it looks like the teething problems with my case node optimisation have been resolved, at least for now.  Granted, platforms outside of Intel haven't been heavily tested yet, I don't think.  I'm worried that https://bugs.freepascal.org/view.php?id=34782 might be because of it, if only because i

Re: [fpc-devel] Case block optimisation

2018-12-27 Thread J. Gareth Moreton
Hi everyone. This is just a follow-up on https://bugs.freepascal.org/view.php?id=34762, since the issue has been marked as resolved now. The apparent regression doesn't seem to exist.  Both the trunk (before it was updated) and the patch produce a linear list for the test in question - e.g.:

Re: [fpc-devel] Case block optimisation

2018-12-27 Thread J. Gareth Moreton
So I've been doing a bit more research, and I think my binary search algorithm is, unfortunately, a failure.  Even after restructuring my lookup table and making some minute optimisations, it's still slower overall in my test program, and slower than a jump tree if that gets used.  I'm figuring th

Re: [fpc-devel] Case block optimisation

2018-12-25 Thread J. Gareth Moreton
Just to clarify, the patch does NOT contain the binary search algorithm.  It does contain a utility function that was accidentally left over when I stripped the code out, named "CreateCMOVInstr", but this can be safely removed. Gareth aka. Kit On Wed 26/12/18 00:27 , "J. Gareth Moreton" gar...

Re: [fpc-devel] Case block optimisation

2018-12-25 Thread J. Gareth Moreton
Merry Christmas everyone! I've uploaded my improvements to a bug report, along with a test program that gives timings and verifies correctness. https://bugs.freepascal.org/view.php?id=34762 It turns out that my binary search algorithm runs slower on average "Domain of 1024" tests (which are

Re: [fpc-devel] Case block optimisation

2018-12-15 Thread J. Gareth Moreton
I'll see what I can do! The one thing about my case optimisations here is that they're done at the node level.  Some parts are platform-independent, but unfortunately, things like jump table generation have to be implemented for each platform. The aint shuffling is a little difficult to test f

Re: [fpc-devel] Case block optimisation

2018-12-15 Thread Martok
Am 15.12.2018 um 18:08 schrieb J. Gareth Moreton: > So here's something else I've been playing with in the interim... I've been > working on improving the algorithms used when compiling case blocks.  It was > driven partly by my binary search idea for certain kinds of case block, which > I > wrote

[fpc-devel] Case block optimisation

2018-12-15 Thread J. Gareth Moreton
Hi everyone, So here's something else I've been playing with in the interim... I've been working on improving the algorithms used when compiling case blocks.  It was driven partly by my binary search idea for certain kinds of case block, which I wrote up over here: http://wiki.freepascal.org/Cas