Jump to content
  • Advertisement

Archived

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

ZGL_Sigma

MMX and floats

This topic is 6008 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

hello there - I''m currently doing a bit with vc''s inline asm - and I have a question : how can I put floats to MMX registers without screwing them ?? it works with doubles but when I use them it would make it all a bit slower - every time I make MMX ops with floats I get something like -1.0#IND even when IO convert double to float - so where''s the problem ???

Share this post


Link to post
Share on other sites
Advertisement
MMX works with integers.
SSE works with floats.

if you have a Pentium III+ then you can use SSE instructions.

developer.intel.com for more information.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
@Jenova it''s not only integers - it can even work with doubles - I tested a bit now with doubles in MMX and floats in "normal" assembler - and the result was very nice - MMX is faster with doubles than "Normal" assembly instructions with floats.

Share this post


Link to post
Share on other sites
are you talking about moving data to the MMX registers. of course you can move a "double" to the MMX registers, it''s just 64 bits of data. MMX instructions operate on "integer" values. SSE/2 instruction operate on "floating point" values.

unless of course the Instruction Set Reference i read (a million times) from Intel''s website is wrong.

http://developer.intel.com/design/pentium4/manuals/24547104.pdf

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
MMX cannot process floating point values. In fact, it even shares the same registers with the FPU, so you can''t use them at the same time. It''s FPU or MMX, and I always go with FPU. That''s why SSE/3DNow were developed, they deal with floating point. MMX is for integers only.

Share this post


Link to post
Share on other sites
that is also why intel made the magical emms op to clear the fpu flags to allow you to use floating point properly again after using mmx. this is also why intel says to keep code fast you NEVER mix floating point and mmx instructions due to the emms overhead. this does not say you cant use floating point at all in yoru software, it merly suggests trying to keep the code segragated from each other (especially do not put them both in the same loop). dont use asm unless you understand the op codes yoru are using and how the registers are setup.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!