Questions tagged [mmx]

MMX is a single instruction, multiple data (SIMD) instruction set designed by Intel, introduced in 1997 with their P5-based Pentium line of microprocessors, designated as "Pentium with MMX Technology"

MMX is a trademark used to reference an extension to the Intel Architecture Instruction set. Officially Intel states the initials are meaningless. This extension adds 57 opcodes, a 64-bit quadword datatype and eight 64-bit registers. These registers can be addressed using the names mm0 through mm7.

To avoid compatibility problems with the context switch mechanisms in existing operating systems, these registers were aliases for the existing x87 FPU stack registers. Unlike the FP stack, the MMn registers are directly addressable.

The main usage of the MMX instruction set is based on the concept of packed data types, which means that instead of using the whole register for a single 64-bit integer, two 32-bit integers, four 16-bit integers, or eight 8-bit integers may be processed concurrently. Thus, the unofficial initials are known as "MultiMedia eXtension" or "Matrix Math eXtension."

The mapping of the MMX registers onto the existing FPU registers made it somewhat difficult to work with floating point and SIMD data in the same application.

MMX provides only integer operations

107 questions
0
votes
2 answers

Integer/Floating points values with SSE

I have to multiply a vector of integers with an other vector of integers, and then add the result (so a vector of integers) with a vector of floating points values. Should I use MMX or SSE4 for integers, or can I just use SSE with all these values…
LuapaJ
  • 51
  • 5
0
votes
1 answer

Porting code frag from MMX to SSE2 asm

I'm trying to port some code from MMX to SSE2 and having a bit of trouble in doing so. For MMX I have: .data align 16 onesByte qword 2 dup(0101010101010101h) ... psubusb mm2,onesByte psubusb mm0,onesByte For SSE2 I have: …
Elegant
  • 143
  • 2
  • 15
0
votes
1 answer

How to write the value of a general-purpose 64 bit register into MMX?

I'm working with x64 assembly and Visual C++ 2010/MASM is telling me that the instruction movq mm0, rax contains "invalid instruction operands". Is this really illegal, or could it be a bug? How does one perform this procedure without using the…
Dziugas
  • 1,500
  • 1
  • 12
  • 28
0
votes
1 answer

Assembly MMX Dotproduct Segmentation fault

I am trying to perform a simple dotproduct calculation of two small arrays using assembly language. Here is my code: #include #include #include void fillArray(int16_t* a, int16_t* b, int n){ std::srand(1); …
Vincent
  • 1,361
  • 2
  • 20
  • 33
0
votes
0 answers

How to use MMX code in c# for image processing

I'm writing an app that makes too many 128bit calculations with C#. (Image processing - 16bit R, 16bit G, 16bit B, 16bit A) Can I calculate this 2 64bit RGBA colors in one cycle. Is there any way to use assembly(MMX) code to do that calculations.
cKNet
  • 635
  • 1
  • 10
  • 22
0
votes
0 answers

ASM - What is the best way to perform (int + int)* float constant with extended instructions?

I'm doing a function in responce to WM_MOUSEMOVE to move my camera in opengl application. The function is to take the STARTING POINT (old lParam from the wm_lbuttondown command)and subtract CURRENT POINT from STARTING POINT, and multiply the result…
Antiusninja
  • 157
  • 1
  • 17
0
votes
1 answer

-g flag changes runtime and compilation of program

I am writing a program that attempts to speed up a Top K filtering alogrithm using SSE and AVX SIMD instructions. I am compiling my program using icc with the flags -o3, -msse3, and -lrt, and the run-time comes out to ~30ms. However, when I put a…
0
votes
1 answer

Help with simple assembly mmx exercise

Given a vector of bytes with length multiple of 8, how can I, using mmx instructions, convert all 2's to 5's, for example? .data v1 BYTE 1, 2, 3, 4, 1, 2, 3, 4 Thanks. edit: 2's and 5's are just an example. They are actually parameters of a…
nunos
  • 20,479
  • 50
  • 119
  • 154
0
votes
1 answer

Compile Error from x86 that uses MOVAPS

I'm getting a compile error of Error: operand type mismatch for 'movaps', and googling hasn't revealed a solution. movups and addps also give the same error. Here's a relevant excerpt: # load address into %eax movaps %eax, %mm0 For completeness,…
user2449436
0
votes
1 answer

Image Processing with MMX in Linux

I want to use the MMX instruction set to optimize my Linux C program, which does lots of operations on images stored in RGB format (each RGB component is stored in an unsigned char). The operations are trivial: I subtract one image from the other…
JB_User
  • 3,117
  • 7
  • 31
  • 51
0
votes
3 answers

I can't assemble movd (MMX) instruction in my visual c express ediion 2008

when I try to compile movd instruction it is showing error as error A2085:instruction or register not accepted in current CPU mode My code is as follows: .386 .model flat, c …
user2004149
  • 87
  • 2
  • 9
0
votes
1 answer

Error compiling inline MMX assembler: Suffix or operands invalid

The following code: simd(n, is) long *is; { long i; asm("pxor %mm0,%mm0"); for (i = 0; i < n; i += W) { asm("movq %0 %%mm1\n\t" "paddq %%mm1 %%mm0" : :"m"(is[i]) ); } return…
MarZalazar
  • 35
  • 4
0
votes
1 answer

Does this MMX mem copy code need a fence?

This basic mmx memory copy code corrupts memory in release mode, but only with certain compilers. Visual Studio 2010 in specific. I think it's because this code needs a memory fence, but I'm not sure where it would go or exactly why. This code…
Drew
  • 101
  • 1
  • 11
0
votes
1 answer

Image quality is decresing when MMX SSE to C code conversion

I am Converting an MMX SSE to Equivalent C Code. I have almost converted it but the image quality what I am getting is not proper or I can see some noise is coming in image. I am debugging the code from last 5 days but I am not getting any reason…
-1
votes
2 answers

How to create a 8 bit mask from lsb of __m64 value?

I have a use case, where I have array of bits each bit is represented as 8 bit integer for example uint8_t data[] = {0,1,0,1,0,1,0,1}; I want to create a single integer by extracting only lsb of each value. I know that using int _mm_movemask_pi8…
yadhu
  • 1,253
  • 14
  • 25