Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: C++
Expertise: Beginner
May 2, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

MMX code in C++

I am involved in a project the aim of which is to demonstrate the effectiveness of MMX for image manipulation. For this project I need to write some MMX code in C++ (MS Visual C++ 5) to simulate how MMX could improve the performance of filters such as Blur, Gaussian Blur, and Unsharp.

I am unsure where to start and would be very grateful for any example source code or advice.

For the most part, the actual machine instructions generated by C and C++ code are determined by the compiler. You have no control over this from your C and C++ language statements. You would need a compiler that had an option to enable these instructions. (They would not be enabled by default, because any code compiled that way would not run on older Pentiums.) Even then, it may not implement them in a way that would demonstrate what your program is trying to show.

The only other hope is if you can use inline assembler. VC++ 5 supports inline assembler, but I'm not sure it supports MMX instructions. I'm also wondering if you are prepared to write your demo using inline assembler.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date