Page 2 of 2

Posted: Tue Aug 30, 2005 4:52 pm
by Dummy
How to create the exe that chooses the right one in PureBasic without ASM-Knowledge?

Posted: Tue Aug 30, 2005 10:38 pm
by Dreglor
Fred were talking about writing code within pb that is specialized for certain CPU instructions using like this

Code: Select all

compilerif #Compiler_SSE
  procedure MyFunction()
    ;sse code
  endprocedure
compilerelseif #Compiler_MMX
  procedure myfunction()
    ;same function but using mmx
  endprocedure
compilerendif
and with dynamic cpu it will include all of them and select on runtime :)

Posted: Thu Sep 01, 2005 3:07 pm
by Dummy
I mean compile several Optimized exes(bin/MyGame_sse, bin/MyGame_3dnow!, bin/MyGame_none)

then make a selector exe:

Code: Select all

compilerif #Compiler_SSE
  runprogram("bin/MyGame_sse")
compilerelseif #Compiler_3DNOW!
  runprogram("bin/MyGame_3dnow!")
compilerelse
  runprogram("bin/MyGame_none")
compilerendif
and with dynamic cpu it will include all of them and select on runtime :)

That'd be what I'd do if it was possible...couse it's a little faster ;) *performance hunter*