MMX/SSE/SSE2/!3DNow/...
MMX/SSE/SSE2/!3DNow/...
Are Calculations(eg: a+b-c/2) in PB Apps MMX/SSE/SSE2/!3DNow/... optimized when I say to Compile a SSE Executable? Can I combine eg: MMX and !3DNow?
-
Codemonger
- Enthusiast

- Posts: 384
- Joined: Sat May 24, 2003 8:02 pm
- Location: Canada
- Contact:
I think this optimization is in place for functions in .lib's only, the docs say this (although my docs may be outdated)
So this means it is up to the person writing the procedures or functions for a library to create seperate functions for different mmx/3dnow extensions. For example if i wanted to create a distance function i could create 3 functions in a .lib file that are oiptimized for different extensions.. and use the dynamic setting to have the program at runtime choose which function to use depending on CPU. obviously it would choose the fastest. OR i could be completely wrong 
Code: Select all
Since PureBasic 3.60, it's possible to creates specialized executables (or dynamic executables)
which can use optimized commands for MMX, 3DNOW, SSE and SSE2 processor. It's done at compile time
or at runtime, depending of the executable type (Normal or Dynamic CPU). Implements an optimized
function is very easy, just put _EXTENSION below the name.
Example (in C) to support MMX and 3DNOW format:
PB_CrossFading (int Rate) // Base function, working on all processors
PB_CrossFading_MMX (int Rate) // MMX optimized
PB_CrossFading_3DNOW (int Rate) // 3DNOW optimized
Now, you have to add in the .desc which optimized functions are available. The following
flags are available: MMX, 3DNOW, SSE and SSE2<br>"I deliver Justice, not Mercy"
    - Codemonger, 2004 A.D.
    - Codemonger, 2004 A.D.