MMX/SSE/SSE2/!3DNow/...

Everything else that doesn't fall into one of the other PB categories.
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

MMX/SSE/SSE2/!3DNow/...

Post by Dummy »

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?
newbie
Enthusiast
Enthusiast
Posts: 296
Joined: Tue Jul 29, 2003 5:47 pm
Location: FRANCE
Contact:

Post by newbie »

I was told before that these optimizations wasn't yet implemented.
Don't know when they will (if they are still not).
- Registered PB user -

Using PB 4.00
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

I think this optimization is in place for functions in .lib's only, the docs say this (although my docs may be outdated)

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
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 :)
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

Is here any assember who can explain me, how exactly these optimations are working?

Why aren't just the normal commands replaced with the quicker ones in the CPU?
Post Reply