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 #247 background imageLoading...
Page #247 background image
Optimizing for SIMD Integer Applications 4
4-27
Highly Efficient Clipping
For clipping signed words to an arbitrary range, the pmaxsw and pminsw
instructions may be used. For clipping unsigned bytes to an arbitrary
range, the
pmaxub and pminub instructions may be used. Example 4-19
shows how to clip signed words to an arbitrary range; the code for
clipping unsigned bytes is similar.
Example 4-19 Clipping to a Signed Range of Words [high, low]
; Input:
; MM0 signed source operands
; Output:
; MM0 signed words clipped to the signed
; range [high, low]
pminsw MM0, packed_high
pmaxsw MM0, packed_low
Example 4-20 Clipping to an Arbitrary Signed Range [high, low]
; Input:
; MM0 signed source operands
; Output:
; MM1 signed operands clipped to the unsigned
; range [high, low]
paddw MM0, packed_min ; add with no saturation
; 0x8000 to convert to unsigned
paddusw MM0, (packed_usmax - high_us)
; in effect this clips to high
psubusw MM0, (packed_usmax - high_us + low_us)
; in effect this clips to low
paddw MM0, packed_low ; undo the previous two offsets

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