TheMMXInstructionSet - The MMX Instruction Set The MMX...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The MMX Instruction Set Beta Draft - Do not distribute © 2001, By Randall Hyde Page 1113 The MMX Instruction Set Chapter Eleven 11.1 Chapter Overview While w orking on the Pentium and Pentium Pro processors, Intel w as also de v eloping an instruction set architecture e xtension for multimedia applications. By studying se v eral e xisting multimedia applications, de v eloping lots of multimedia related algorithms, and through simulation, Intel de v eloped 57 instructions that w ould greatly accelerate the e x ecution of multimedia applications. The end result w as their multimedia e xtensions to the Pentium processor that Intel calls the MMX T echnology Instructions. Prior to the in v ention of the MMX enhancements, good quality multimedia systems required separate digital signal processors and special electronics to handle much of the multimedia w orkload 1 . The introduc - tion of the MMX instruction set allo wed later Pentium processors to handle these multimedia tasks without these e xpensi v e digital signal processors (DSPs), thus lo wering the cost of multimedia systems. So later Pentiums, Pentium II, Pentium III, and Pentium IV processors all ha v e the MMX instruction set. Earlier Pentiums (and CPUs prior to the Pentium) and the Pentium Pro do not ha v e these instructions a v ailable. Since the instruction set has been a v ailable for quite some time, you can probably use the MMX instructions without w orrying about your softw are f ailing on man y machines. In this chapter we will discuss the MMX T echnology instructions and ho w to use them in your assembly language programs. The use of MMX instructions, while not completely limited to assembly language, is one area where assembly language truly shines since most high le v el languages do not mak e good use of MMX instructions e xcept in library routines. Therefore, writing f ast code that uses MMX instructions is mainly the domain of the assembly language programmer . Hence, it’ s a good idea to learn these instructions if you’ re going to write much assembly code. 11.2 Determining if a CPU Supports the MMX Instruction Set While it’ s almost a gi v en that an y modern CPU your softw are will run on will support the MMX e xtended instruction set, there may be times when you w ant to write softw are that will run on a machine e v en in the absence of MMX instructions. There are tw o w ays to handle this problem – either pro vide tw o v ersions of the program, one with MMX support and one without (and let the user choose which program the y wish to run), or the program can dynamically determine whether a processor supports the MMX instruction set and skip the MMX instructions if the y are not a v ailable. The fi rst situation, pro viding tw o dif ferent programs, is the easiest solution from a softw are de v elop - ment point of vie w . Y ou don’ t actually create tw o source fi les, of course; what you do is use conditional compilation statements (i.e., #IF ..#ELSE. .#ENDIF) to selecti v ely compile MMX or standard instructions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 38

TheMMXInstructionSet - The MMX Instruction Set The MMX...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online