Archived

This topic is now archived and is closed to further replies.

Promit

Writing cross-platform SSE/3DNow code

Recommended Posts

Promit    13246
I''m currently looking at rewriting certain functions with SSE/3DNow, but I want to maintain cross-platformness. I don''t mean CPU cross-platform, but rather, OS and compiler cross-platform. I want to have code that will compile on both VS6 (with Processor Pack) and g++ (need any packs?). Are there any specific directives I need to give either compiler? Can I give the same directive to both? Does g++ need any special stuff to emit SSE/3DNow code? I''m just starting to look at this, so I need to know these things so I can plan accordingly.

Share this post


Link to post
Share on other sites
samgzman    160
just #ifdef directives and include and access code as is appropriate. The only other thing you need to take into consideration is supportive code for each CPU types....is rather that simple.

Share this post


Link to post
Share on other sites
Promit    13246
What''s the g++ syntax for using proc-specific code literally?

Also, can g++ generate SSE and 3DNow! native instructions from C/C++ code with the -march=(athlon|pentium3) flag?

Share this post


Link to post
Share on other sites
Null and Void    1088
quote:
Original post by Promit
Also, can g++ generate SSE and 3DNow! native instructions from C/C++ code with the -march=(athlon|pentium3) flag?

It can in theory (which is why the -mmmx, -m3dnow, -msse, and -msse2 flags were added) but I don''t think it''s implemented yet (I haven''t really checked in a while so they could have started on it by now).

Share this post


Link to post
Share on other sites