Re: [fpc-pascal] Translate C code

2018-01-05 Thread Karoly Balogh (Charlie/SGR)
Hi, On Sat, 6 Jan 2018, Darius Blaszyk wrote: > Again I would like to ask some support on a piece C code that I need to > translate to pascal. The code in question is: > > #define MEMNEXT(x) ((MyStruct *)(((char *) x) - ((char *) & (((MyStruct > *)0)->next > > What exactly is going on here?

[fpc-pascal] Translate C code

2018-01-05 Thread Darius Blaszyk
Hi all, Again I would like to ask some support on a piece C code that I need to translate to pascal. The code in question is: #define MEMNEXT(x) ((MyStruct *)(((char *) x) - ((char *) & (((MyStruct *)0)->next What exactly is going on here? Where does the result point to? It seems like it

Re: [fpc-pascal] Modern Compiler Construction using Pascal

2018-01-05 Thread Graeme Geldenhuys
On 2018-01-02 15:30, Marc Santhoff wrote: Sorry for mentioning something nasty like Java on this list. The more I use Java (and the ecosystem around it) the more I love it. :) It is expected that any developer these days are proficient in multiple languages. Object Pascal (Delphi) and Java

Re: [fpc-pascal] Register Allocation on x86_64

2018-01-05 Thread Jonas Maebe
On 05/01/18 16:41, Martok wrote: is it possible that the register allocation on x86_64 is a bit inefficient? No matter the optimization settings, I can never get FPC to use more than the rax and rdx registers. Especially $Optimization REGVAR does nothing (not even for loop variables). Instead,

[fpc-pascal] Register Allocation on x86_64

2018-01-05 Thread Martok
Hi all, is it possible that the register allocation on x86_64 is a bit inefficient? No matter the optimization settings, I can never get FPC to use more than the rax and rdx registers. Especially $Optimization REGVAR does nothing (not even for loop variables). Instead, two nested loops are enough