Forum > General

Different builds for more recent processors and a little older ones

(1/3) > >>

daniel_sap:
Hi

I was thinking that if I can build different executables for people who bought more recent processors and those with older ones
may lead to some benefits, like
- people with newer cpus can take advantage of newer instructions and have faster app

I can put checks in the Web Installer for the current system and download the proper executable

Do you think this is good idea and is there something in FPC in this direction.

Also, I suppose a lot of new instructions are not used to have compatibility.

paule32:
download FPC deluxe
and with a stub Bootstrap Compiler, you can Create FPC Version's for a wide range of FPC for different CPU's and different OS's.

Luck Luke
...

Martin_fr:
Well, first check how much of an improvement that actually gets. Is it noticeable?

Also, are all of you routines affected, or is the speed gain limited to some few procedures?
If it is only some code, you can even include both versions of the procedure, and then decide at runtime which to call.

For Intel (and likely AMD) play with "loopalign = 32". Especially for very small loops with lots of iterations. Doing it for all your code may be counter productive.

Thaddy:

--- Quote from: daniel_sap on March 15, 2025, 01:02:10 pm ---- people with newer cpus can take advantage of newer instructions and have faster app

--- End quote ---
This is already possible/ has always been possible.
Only the very cutting edge CPU's may not be there yet.
Type fpc -ifco in a terminal/console
E.g. in trunk for x86_64 that gives you (fpu,cpu, optimizations):

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---NONESSE64X86-64-V1SSE3SSSE3SSE41SSE42X86-64-V2AVXFMAAVX2X86-64-V3AVX512FX86-64-V4 ATHLON64X86-64X86-64-V1COREIX86-64-V2BOBCATCOREAVXJAGUARPILEDRIVEREXCAVATORCOREAVX2X86-64-V3ZENZEN2X86-64-V4SKYLAKE-XICELAKEICELAKE-CLIENTICELAKE-SERVERZEN3ZEN4ZEN5 REGVARSTACKFRAMEPEEPHOLELOOPUNROLLTAILRECCSEDFASTRENGTHUSERBPORDERFIELDSFASTMATHREMOVEEMPTYPROCSCONSTPROPUSELOADMODIFYSTOREUNUSEDPARAFORLOOPHow the compiler is build and for what CPU does not matter. You can even generate code for more modern cpu's on a machine with a relatively old one: generate code that does not run on the cpu you used to compile....

marcov:
Being 64-bit already raises the minimal instruction level considerably. I don't think the average code has much advantage from the extensions after that. A problem is also that some of those are not defined by ABI.

Some compression code that uses the bitscan and -count primitives might benefit in theory. Maybe a few newer instructions are slightly faster than older alternatives, but that will be rare.

Thaddy: the recompile is to make RTL/libraries also use that optimization level, not the compiler

Navigation

[0] Message Index

[#] Next page

Go to full version