#### Archived

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

# 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.

## 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 on other sites
I Wish I Could Help....
But....

##### Share on other sites
Erik, if you can''t help, why bother posting something saying that you can''t help??

/. Muzzafarath

##### Share on other sites
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

• 10
• 33
• 29
• 9
• 15