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
2
votes
3 answers

MMX operation (add 16bit is not done)

I got some vectors containing unsigned chars that represent pixels from a frame. I got this function working without the MMX improvement, but I frustrated whit MMX that doesnt work ... So: I need to add two unsigned chars (the sum need to be done as…
Paiva
  • 23
  • 3
2
votes
1 answer

Is there a way to auto-generate MMX instructions (not SSE) with gcc

It appears gcc will happily auto-vectorize simple examples, and emit SSE instructions. Is there any way to emit MMX instructions only? For example if I try the following example on Godbolt: int sumint(int *arr) { int sum = 0; for (int i=0 ;…
Ant6n
  • 1,887
  • 1
  • 20
  • 26
2
votes
2 answers

Calculate f(x)=2*(x^2)+5 with saturation using MMX instruction set for 128 numbers with size of 2 bytes loaded from a binary file

I have this problem where I need to calculate function f(x)=2*(x^2)+5 with MMX instruction set. I have two problems. This is my code for now: section .data print_fmt db '%d', 10, 0 my_loaded_data times 128 dw 0 fives times 4 dw 5 …
Nebeski
  • 610
  • 4
  • 14
2
votes
1 answer

Using SIMD to right shift 32 bit packed negative number

I'm writing some SSE/AVX code and there's a task to divide a packed signed 32 bit integers by 2's complement. When the values are positive this shift works fine, however it produces wrong results for negative values, because of shifting the sign…
Isso
  • 1,285
  • 11
  • 23
2
votes
0 answers

Conversion of NV12 to YUY2

In an existing Visual Studio 2015 C++ 32-bit Windows project I have a function for converting a video frame from NV12 to YUY2, which is basically just shuffling bytes around. Here it is: void ConvertNV12toYUY2(int nInputHeight, …
appleton
  • 168
  • 1
  • 11
2
votes
1 answer

Need to Build for i586 target with GCC 5.3 i686 Host Toolchain

I need to build for an i586 target (no MMX instructions) using GCC 5.3 within a i686 host environment (32 bit Ubuntu Docker container). The host toolchain is i686. Is there anyway to do this without building a i586 cross-compiler ?
crayguy
  • 75
  • 6
2
votes
0 answers

Assembly MMX Summer - pshufw - Error A2085

I am using visual studio 2005 to practice writing some assembly code. I wrote a simple function using .mmx. Here is the complete file .586 .mmx .model flat,c .code Sum_ proc ; Sun_(unsigned short int*, number) ;Pre…
2
votes
3 answers

Why can't I remove _mm_empty()?

I have a c++ function with some SSE2 instructions. The problem is i am getting the following linker error when compiling this code using microsoft visual c++: unresolved external symbol _m_empty referenced in function "void * __cdecl process(void…
Mbt925
  • 1,317
  • 1
  • 16
  • 31
2
votes
1 answer

What is the difference between _m_empty and _mm_empty?

While I was looking for MMX functions, I noticed that two of them, _m_empty and _mm_empty, have exactly the same definition. So why do they both exist ? Is one of them older than the other ? Is there a difference that is not mentioned in the manual…
Aracthor
  • 5,757
  • 6
  • 31
  • 59
2
votes
2 answers

What does AT&T syntax do about ambiguity between other mnemonics and operand-size suffixes?

In AT&T syntax instructions often have to be suffixed with the appropriate operand size, with q for operations on 64-bit operands. However in MMX and SSE there is also movq instruction, with the q being in the original Intel mnemonic and not an…
phuclv
  • 37,963
  • 15
  • 156
  • 475
2
votes
1 answer

Inline ASM: Use of MMX returns NaN seconds on timer

Problem I am trying to find out whether mmx or xmm registers are faster for copying elements of an array to another array (I know about memcpy() but I need this function for a very specific purpose). My souce code is below. The relevant function is…
matmul
  • 589
  • 5
  • 16
2
votes
1 answer

SIMD integer store

I am writing a program using SSE instructions to multiply and add integer values. I did the same program with floats but I am missing an instruccion for my integer version. With floats, after I have finished all my operations, I return de values…
Thudor
  • 349
  • 2
  • 7
2
votes
1 answer

Unable to activate the SSE instruction set by "-march=native" in gcc or any other flags in Core2 chip

My machine is Core2 microarchitecture and I tried to compile some arithmetic code targeting the SSE instruction set. I searched on the web and official manual, and I believe that all I need to do is to add the flag -march=native, because my chip…
2
votes
3 answers

How to add each byte of an 8-byte long integer?

I'm learning how to use the Intel MMX and SSE instructions in a video application. I have an 8-byte word and I would like to add all 8 bytes and produce a single integer as result. The straightforward method is a series of 7 shifts and adds, but…
JB_User
  • 3,117
  • 7
  • 31
  • 51
2
votes
1 answer

(a*b)/256 and MMX

I'm wondering if it is possible to do the following calculation with four values parallel within a MMX-Register: (a*b)/256 where a is a signed word and b is an unsigned value (blend factor) in the range of 0-256 I think my problem is that I'm not…
jsi1
  • 23
  • 2