(05-07-2013, 10:01 PM)xemnas99 Wrote: Yes. I mean the PC games can do the same way. They don't need to stick to SSE2 or below but they can detect the hardware at run-time like when launching the game and select the plugin/mode/whatever accordingly.
Those are instructions the CPU can execute, then yes if the application has modules compiled with specific arch this can be done, but it's not like happens most of time.
A lot more common is having one or more engine versions, one based on DX9, other based on DX10 and so on but I'm yet to see different modules for those instruction set... and for a reason.
There is no sense coding extra modules to make actual advantageous use of the new instructions what could translate in not only a minor performance gain but to allow things hard to implement or even feasible with the older set. If not for any other reason because dealing with testing and debug of different modules versions to do the same thing is something the devs wont do.
Then, rests the architecture can be defined at compile time so the most advanced set is used... but for this exist the minimal hardware requirement and this minimal requirement is what defines the set the application is compiled.
Notice how this approach is completely different from the plugin (GSDX in the case). While in the game's development the focus is in getting the best of an unique and specific application, the plugin is designed to deal with a code it does not know a priori coming from different games. It has to deal with whatever comes from the game, more specifically with comes from the emulator's core which already has to deal with a non previously known game's code.
The emulator works very different from the game, it dynamically recompiles chunks of code (one the most common techniques nowadays) and so it could make use for generic translation using different instructions set... but ask the core developers if they are willing to do it.
That's done on GSDX first to decide the DirectX to use, and then to decide the instruction set to use. But notice as just compiling with AVX support did nothing to help hardware mode... that's because the plugin simply does not use AVX exclusive instructions in this mode, it uses it only in the software mode ATM.
This hopefully helps understanding that is not enough compile with a flag, to get the best of new instruction set the program, plugin, whatever needs to actually use it. May exist a natural gain independent of the high level source code at compilation time but it's not gain enough to lure game developers to buy fleas for themselves to itch.
PS: Besides, is not like the game developers are desperately trying to get the last performance drop, the emulator's devs are, this is the reason for those many different GSDX versions, and the gain is not so big even so.
PPS: If you meant the CPU will chose the instruction at run time, think again, it will just execute the machine code as it comes. At most it will make branch prediction so to be able to better distribute and use the incoming code, but nothing beyond this. The last thing that is needed is CPU making logic interpretation mistakes.