[fpc-pascal] Does the compiler make prodigious use of use ENTER instruction?

Jonas Maebe jonas at freepascal.org
Tue Dec 12 21:44:04 CET 2023


On 12/12/2023 17:48, Anthony Walter via fpc-pascal wrote:
> Do any of the compiler devs know if Pascal programs for the x86 
> instruction set are using ENTER and its second argument to the best 
> possible effect? I am curious.

FPC used it in the past, but stopped using it because
1) on modern processors the expanded sequence is much faster than the 
single enter instruction
2) enter is limited to allocating stack frames of 32kb or 64kb (so we 
had to support non-enter-based entry code anyway)
3) IIRC the Linux kernel doesn't support the enter instruction (if it 
requires a new page to be allocated for the stack, I believe it can 
crash the program)

TP did use it.


Jonas


More information about the fpc-pascal mailing list