Jump to content
  • Advertisement

Archived

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

Goodlife

My life for a code snippet!

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

Hi gang-- remember me? I wrote the now famous, beautifully written "MMX, my distant love" post below. It was eloquent, and you know it. Okay, so no floating point. However, I still want to do my vertex transforms without directx sometimes-- again, because when I transform, I don''t do 3-d rotations... I only need to do 2d rotations in some instances. But I am utterly unfamiliar with MMX, but only need a tiny code snippet to get me going. Could someone post (pretty please!) a lil'' code snippet that does the following in MMX? long vertex_x; long vertex_y; long multix; long multiy; vertex_x*=multix; vertex_y*=multiy; Again, I know this seems very rudimentary, but if someone could just show me MMX code for this, I''ll be able to figure out what I need from it. Thanks a billion! -- Goodlife ----------------------------- Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
There is no MMX instruction to multiply to 32-bit values. The only multiply instructions that are available are the following:

pmaddwd: multiply and add 4 16-bit values to 4 16-bit values and store 2 32-bit values

pmulhw: multiply 4 16-bit values to 4 16-bit values and store 4 16-bit values of the high word of the product

pmullw: multiply 4 16-bit values to 4 16-bit values and store 4 16-bit values of the low word of the product

Sorry.

Mike

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!