need help with mmx (vc++)

S

Soulblazer

I have a loop that I think can benefit from MMX instructions, but not
sure how to do it. I read through the manuals but nothing registers
(no pun intended).

Basically I loop through a graphics buffer (16 bit) with a right shift
and an AND operation. I've basically been loading in 32 bits and
doing two RGB's at a time, but I'm sure MMX must have a faster way.
Here is an example psuedo:

for ()
{
int data;
...
data = (data >> 1) & 0xF7F7F7F7; // 1 and 0xF7F7F7F7 are
constants
...
}

Can someone help translate this to an inline (MSVC) MMX version?
I would be most appreciative!
 
V

Victor Bazarov

Soulblazer said:
I have a loop that I think can benefit from MMX instructions, but not
sure how to do it. I read through the manuals but nothing registers
(no pun intended).

Basically I loop through a graphics buffer (16 bit) with a right shift
and an AND operation. I've basically been loading in 32 bits and
doing two RGB's at a time, but I'm sure MMX must have a faster way.
Here is an example psuedo:

for ()
{
int data;
...
data = (data >> 1) & 0xF7F7F7F7; // 1 and 0xF7F7F7F7 are
constants
...
}

Can someone help translate this to an inline (MSVC) MMX version?

There is no 'MMX' in C++ language. Perhaps you need help in assembly
language, then this is not the right place to ask for it.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top