does the compiler create clone code for each processer so when run on amd it will do the 3dnow! instructions and on intel will use sse2 instuctions?
or is it just uses instructions that aren't cpu spcific?
Check the section "Using the command line compiler" in the manual
PB manual wrote:
/DYNAMICCPU: Creates a executable containing all the available processor specific routines. When the program is started, it looks for the processor type and then select the more appropriates routines to use. This makes a bigger executable, but result in the fastest possible program.
To my knowledge there are very few(if any) library commands that come in mmx, 3dnow! optimized versions.
The ASM that the compiler produces itself is to my knowledge only generic ASM.
My guess is that a jumptable for the functions in question (for the ones that have CPU specific optimizations) is set up in the init code. This is however only a guess from my side, Fred would know for sure, i hope
That's exaclty as Pupil said (you can see that when using the /COMMENTED code with a function which actually support it (actually there is no internal PB functions which use it, but some user libs could)).
thefool wrote:Wondering, if its turned on how will the exe work on lets say non-3dnow cpu's? Will the code that works on all cpu's be included too?
If you set it to for example MMX and you happen to use some functions that support this, the executable of course won't work on non-MMX processors.
It seems to me like the point of "dynamic" is to include all function sets and then pick the best at runtime. (So then it will of course run on any processor.)
i asked if it just meant that the mmx was included. So the size grew bigger but exe worked on all cpu's as well. Its not all "Of course".... i doubt it will include functions for mmx or 3dnow when using dynamic.
When using dynamic CPU all specialized routines will be included which means a probably bigger exe, but also the fastest possible (as each routine will be used depending of the CPU where the exe is running on).
it be a good idea if we could have compiler Constants for these so you could write 3dnow!,SSE,MMX version of certain procedures or parts of code that would be nice