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
1
vote
1 answer

What have I done wrong Converting my MMX Intrinsics to x64 (SSE)?

I understand converting MMX 32bit mmx intrinsics no longer allows the __m64. So I was having great trouble upgrading this piece of code to SSE. I was told on another stack-Overflow post to post my code. Perhaps this exercise will help others as…
Robert Koernke
  • 436
  • 3
  • 18
1
vote
0 answers

Why there is no mоvb and mоvw instructions in MMX set?

There is mоvq and mоvd, but mоvb and mоvw aren't exist. Why? Don't we need to mоve bytes and words?
prytkov
  • 11
  • 1
1
vote
2 answers

Why there is no pmulluw, pslad and pslaw commands in MMX?

Why there is no pmulluw, pslad and pslaw commands in MMX? And why there is no movb and movw commands?
just_user
  • 91
  • 1
  • 2
1
vote
1 answer

Stack usage with MMX intrinsics and Microsoft C++

I have an inline assembler loop that cumulatively adds elements from an int32 data array with MMX instructions. In particular, it uses the fact that the MMX registers can accommodate 16 int32s to calculate 16 different cumulative sums in parallel. I…
ARF
  • 7,420
  • 8
  • 45
  • 72
1
vote
0 answers

Why is SDL_HasMMXExt missing in SDL2

In SDL 1.2, there is SDL_HasMMXExt. See here. The full source of the file can be seen here. In SDL 2, that function is missing. Why? The full source of SDL2 of the same file can be seen here. Relevant code of SDL 1.2 is this: static __inline__ int…
Albert
  • 65,406
  • 61
  • 242
  • 386
1
vote
1 answer

How to count average of 3 integers via mmx?

I have a problem, hope that you will help. I have a task to perform grayscaling of image (sent from Java) using mmx, xmm or sse commands. I've already done this in C and asm (taking R, G and b using logics and then finding avg), now I need to use…
JonathanX64
  • 93
  • 1
  • 10
1
vote
4 answers

Errors using inline assembly in C

I'm trying my hand at assembly in order to use vector operations, which I've never really used before, and I'm admittedly having a bit of trouble grasping some of the syntax. The relevant code is below. unit16_t asdf[4]; asdf[0] = 1; asdf[1] =…
user1274193
  • 1,104
  • 1
  • 10
  • 11
1
vote
2 answers

Assembly mask logic question

This is very simple, but I haven't been able to figure it out yet. This question is regarding a assembly mmx, but it's pure logic. Imagine the following scenario: MM0: 04 03 02 01 04 03 02 01 <-- input MM1: 02 02 02 02 02 02 02 02 MM2: 04 03 02…
nunos
  • 20,479
  • 50
  • 119
  • 154
1
vote
0 answers

"error C2400: inline assembler syntax error in ‘opcode’" pxor compiling ffmpeg with mmx flag enabled

I'm trying to compile (visual studio 2005) ffmpeg with mmx flag enabled (HAVE_MMX) but get the following error: "error C2400: inline assembler syntax error in ‘opcode’" And it's complaining about xpor_r2r Ideas? [Update] Jester pointed out that it's…
Kristofer
  • 3,201
  • 23
  • 28
1
vote
1 answer

Binary logarithm in O(1) time (operating on registers x86 or SIMD) without shifting?

I wanted to see if there is a method for finding the binary log of a number. Say you have the number 4 then the power to which you raise two to get four is 2. I know this is possible with shifting and counting but that uses O(N) operations. Is there…
pandoragami
  • 5,387
  • 15
  • 68
  • 116
1
vote
1 answer

GAS, MOVQ Throws operand mismatch, when trying to copy rax to mmx register

I'm using gnu assembly and gcc compiler. I have to make some operations using mmx registers. I've got a memory buffer of bytes, I'm reading 1 byte from memory to %al, making logical and operation and shifting rax left by 1 byte and inserting on…
Vilo
  • 152
  • 1
  • 1
  • 13
1
vote
1 answer

Is there any instruction to add all bytes in an MMX register?

I need to calculate the sum of the 4 integers I have inside a MMX register. For example, I have this MMX register: And I want to get this result (I don't mind if it's in the same register or if it's in a normal one): I want to know if there is an…
vguzmanp
  • 785
  • 1
  • 10
  • 31
1
vote
1 answer

MMX - working with constant bytes

I've been working on something and run into another couple of problems. First off: ROR64 macro a, rot ; Result := (A shl (64-rot)) xor (A shr rot); MOV EAX, 64 SUB EAX, rot PSLLQ a, EAX MOVQ mm6, a PSRLQ mm6, rot PXOR …
Glenn1234
  • 2,542
  • 1
  • 16
  • 21
1
vote
1 answer

MMX error A2022:instruction operands must be the same size

I'm trying to handtune a piece of code(a function originally writen in C++) and the assembler throws this error: error A2022:instruction operands must be the same size at the lines that use the 'movq' instruction. The code: .686P .mmx …
Sebi
  • 4,262
  • 13
  • 60
  • 116
1
vote
2 answers

load 32 bits from memory into xmm register

inline assembly: __asm__("movd (%0), %%xmm1" : : "r"(some_pointer) :); What is the equivalent intrinsics code? __m128i foo = _mm_?????(some_pointer);
fredoverflow
  • 256,549
  • 94
  • 388
  • 662