EasyManuals Logo

Intel ARCHITECTURE IA-32 User Manual

Intel ARCHITECTURE IA-32
568 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #280 background image
IA-32 Intel® Architecture Optimization
5-18
Example 5-8 illustrates how to use MMX technology code for copying
or shuffling.
Horizontal ADD Using SSE
Although vertical computations use the SIMD performance better than
horizontal computations do, in some cases, the code must use a
horizontal operation. The
movlhps/movhlps and shuffle can be used to
sum data horizontally. For example, starting with four 128-bit registers,
to sum up each register horizontally while having the final results in one
register, use the
movlhps/movhlps instructions to align the upper and
lower parts of each register. This allows you to use a vertical add. With
the resulting partial horizontal summation, full summation follows
easily. Figure 5-3 schematically presents horizontal add using
movhlps/movlhps, while Example 5-9 and Example 5-10 provide the
code for this operation.
Example 5-8 Using MMX Technology Code for Copying or Shuffling
movq mm0, [Uarray+ebx] ; mm0= u1 u2
movq mm1, [Varray+ebx] ; mm1= v1 v2
movq mm2, mm0 ; mm2= u1 u2
punpckhdq mm0, mm1 ; mm0= u1 v1
punpckldq mm2, mm1 ; mm2= u2 v2
movq [Coords+edx], mm0 ; store u1 v1
movq [Coords+8+edx], mm2 ; store u2 v2
movq mm4, [Uarray+8+ebx] ; mm4= u3 u4
movq mm5, [Varray+8+ebx] ; mm5= v3 v4
movq mm6, mm4 ; mm6= u3 u4
punpckhdq mm4, mm5 ; mm4= u3 v3
punpckldq mm6, mm5 ; mm6= u4 v4
movq [Coords+16+edx], mm4 ; store u3 v3
movq [Coords+24+edx], mm6 ; store u4 v4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Intel ARCHITECTURE IA-32 and is the answer not in the manual?

Intel ARCHITECTURE IA-32 Specifications

General IconGeneral
Instruction Setx86
Instruction Set TypeCISC
Memory SegmentationSupported
Operating ModesReal mode, Protected mode, Virtual 8086 mode
Max Physical Address Size36 bits (with PAE)
Max Virtual Address Size32 bits
ArchitectureIA-32 (Intel Architecture 32-bit)
Addressable Memory4 GB (with Physical Address Extension up to 64 GB)
Floating Point Registers8 x 80-bit
MMX Registers8 x 64-bit
SSE Registers8 x 128-bit
RegistersGeneral-purpose registers (EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP), Segment registers (CS, DS, SS, ES, FS, GS), Instruction pointer (EIP), Flags register (EFLAGS)
Floating Point UnitYes (x87)

Related product manuals