Jump to content
  • Advertisement
Sign in to follow this  

gcc/mingw sse/3dnow and c++

This topic is 5039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know that mingw/gcc supports sse/3dnow, but i'm not sure how to ensure the compiler vectorizes my code. If i make a matrix/vector/quaternion... library and compile it with mingw/gcc is there a particular way to code it to ensure it compiles to take advantage of said instruction sets? Use arrays of four floats??? Make sure the data is aligned properly?? Oh and is there a vector/matix/quternion library available for mingw that already takes advantage of sse/3dnow? (preferebly lgpl)

Share this post

Link to post
Share on other sites
In terms of just having the compiler user sse for fp math, you can use:


(so also need to specify an architecture that has sse)

in terms of writing mmx or sse code, see:






and this page:

hope that helps

Share this post

Link to post
Share on other sites
Thanks alot, that reminds me alot of the 'intrinsics' with the intel compiler that i had read about. However i was refering to automatic vectorization, whereby i write a class in c++ and the compiler automatically uses the best availble method for implementing it. I remember reading somewhere that for the aforementioned intel compiler to automatically vectorize code you had to setup your data as arrays of floats in order for the compiler to recognize that said code would be vectorizable. But again thanks, i'll look into the 'intrinsics'.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!