[fpc-devel] Question on updating FPC packages

Florian Klämpfl florian at freepascal.org
Sat Oct 26 19:31:42 CEST 2019


Am 26.10.19 um 18:51 schrieb J. Gareth Moreton:
> 
> The "const" suggestion was made by a third party, and while I went out 
> of my way to ensure the functions aren't changed in Pascal code, Florian 
> pointed out that it could break existing assembler code.  Maybe I'm 
> being a bit stubborn or unreasonable, I'm not sure, but in my eyes, 
> using assembly language to directly call the uComplex functions and 
> operators seems rather unrealistic.  I figured if you're writing in 
> assembly language, especially if you're using vector registers, you'd be 
> using your own code to play around with complex numbers.  Plus I figured 
> that if you're developing on a non-x86_64 platform, the only thing 
> that's different are the 'const' modifiers, which I don't think changes 
> the way you actually call the function, regardless of platform.  Am I 
> right in this?
> 
> The intention was to make the lightweight unit even more lightweight and 
> optimal, without breaking backwards compatibility.  

I do not like such (micro-)optimziations working around a lazy compiler. 
I saw similar patches in lazarus recently (adding inline). This is imo a 
waste of time and clutters only code. It is much more beneficial to 
improve the compiler to avoid a copying of the variable if it can prove 
that it is not needed (or to improve auto inlining if it does not work 
in certain cases). And in this case it would probably possible to find 
out that a copy is not needed.


More information about the fpc-devel mailing list