3DNow!
Template:Short descriptionTemplate:Infobox computer hardware 3DNow! is a deprecated extension to the x86 instruction set developed by Advanced Micro Devices (AMD). It adds single instruction multiple data (SIMD) instructions to the base x86 instruction set, enabling it to perform vector processing of floating-point vector operations using vector registers. This improvement enhances the performance of many graphics-intensive applications. The first microprocessor to implement 3DNow! was the AMD K6-2, introduced in 1998. In appropriate applications, this enhancement raised the speed by about 2–4 times.<ref>Template:Cite web</ref>
However, the instruction set never gained much popularity, and AMD announced in August 2010 that support for 3DNow! would be dropped in future AMD processors, except for two instructions, PREFETCH and PREFETCHW.<ref>Template:Cite web</ref> These two instructions are also available in Bay-Trail Intel processors.<ref>Template:Cite web</ref>
History
3DNow! was developed at a time when 3D graphics were becoming mainstream in PC multimedia and games. Realtime display of 3D graphics depended heavily on the host CPU's floating-point unit (FPU) to perform floating-point calculations, a task in which AMD's K6 processor was easily outperformed by its competitor, the Intel Pentium II.
As an enhancement to the MMX instruction set, the 3DNow! instruction-set augmented the MMX SIMD registers to support common arithmetic operations (add/subtract/multiply) on single-precision (32-bit) floating-point data. Software written to use AMD's 3DNow! instead of the slower x87 FPU could execute up to four times faster, depending on the instruction mix.
Versions
3DNow!
The first implementation of 3DNow! technology contains 21 new instructions that support SIMD floating-point operations. The 3DNow! data format is packed, single-precision, floating-point. The 3DNow! instruction set also includes operations for SIMD integer operations, data prefetch, and faster MMX-to-floating-point switching. Later, Intel would add similar (but incompatible) instructions to the Pentium III, known as SSE (Streaming SIMD Extensions).
3DNow! floating-point instructions are the following: Template:Div col
PI2FDTemplate:Snd Packed 32-bit integer to floating-point conversionPF2IDTemplate:Snd Packed floating-point to 32-bit integer conversionPFCMPGETemplate:Snd Packed floating-point comparison, greater or equalPFCMPGTTemplate:Snd Packed floating-point comparison, greaterPFCMPEQTemplate:Snd Packed floating-point comparison, equalPFACCTemplate:Snd Packed floating-point accumulatePFADDTemplate:Snd Packed floating-point additionPFSUBTemplate:Snd Packed floating-point subtractionPFSUBRTemplate:Snd Packed floating-point reverse subtractionPFMINTemplate:Snd Packed floating-point minimumPFMAXTemplate:Snd Packed floating-point maximumPFMULTemplate:Snd Packed floating-point multiplicationPFRCPTemplate:Snd Packed floating-point reciprocal approximationPFRSQRTTemplate:Snd Packed floating-point reciprocal square root approximationPFRCPIT1Template:Snd Packed floating-point reciprocal, first iteration stepPFRSQIT1Template:Snd Packed floating-point reciprocal square root, first iteration stepPFRCPIT2Template:Snd Packed floating-point reciprocal/reciprocal square root, second iteration step
3DNow! integer instructions are the following:
PAVGUSBTemplate:Snd Packed 8-bit unsigned integer averagingPMULHRWTemplate:Snd Packed 16-bit integer multiply with rounding
3DNow! performance-enhancement instructions are the following:
FEMMSTemplate:Snd Faster entry/exit of the MMX or floating-point statePREFETCH/PREFETCHWTemplate:Snd Prefetch at least a 32-byte line into L1 data cache (this is the only non-deprecated instruction)
3DNow! extensions
There is little or no evidence that the second version of 3DNow! was ever officially given its own trade name. This has led to some confusion in documentation that refers to this new instruction set. The most common terms are Extended 3DNow!, Enhanced 3DNow! and 3DNow!+. The phrase "Enhanced 3DNow!" can be found in a few locations on the AMD website but the capitalization of "Enhanced" appears to be either purely grammatical or used for emphasis on processors that may or may not have these extensions (the most notable of which references a benchmark page for the K6-III-P that does not have these extensions).<ref name="extman">Template:Cite web</ref><ref>Template:Cite web</ref>
This extension to the 3DNow! instruction set was introduced with the first-generation Athlon processors. The Athlon added five new 3DNow! instructions and 19 new MMX instructions. Later, the K6-2+ and K6-III+ (both targeted at the mobile market) included the five new 3DNow! instructions, leaving out the 19 new MMX instructions. The new 3DNow! instructions were added to boost DSP. The new MMX instructions were added to boost streaming media.
The 19 new MMX instructions are a subset of Intel's SSE instruction set. In AMD technical manuals, AMD segregates these instructions apart from the 3DNow! extensions.<ref name="extman"/> In AMD customer product literature, however, this segregation is less clear where the benefits of all 24 new instructions are credited to enhanced 3DNow! technology.<ref>Template:Cite web</ref> This has led programmers to come up with their own name for the 19 new MMX instructions. The most common appears to be Integer SSE (ISSE).<ref>Template:Cite web</ref> SSEMMX and MMX2 are also found in video filter documentation from the public domain sector. ISSE could also refer to Internet SSE, an early name for SSE.
3DNow! extension DSP instructions are the following:
PF2IWTemplate:Snd Packed floating-point to integer word conversion with sign extendPI2FWTemplate:Snd Packed integer word to floating-point conversionPFNACCTemplate:Snd Packed floating-point negative accumulatePFPNACCTemplate:Snd Packed floating-point mixed positive-negative accumulatePSWAPDTemplate:Snd Packed swap doubleword
MMX extension instructions (Integer SSE) are the following: Template:Div col
MASKMOVQTemplate:Snd Streaming (cache bypass) store using byte maskMOVNTQTemplate:Snd Streaming (cache bypass) storePAVGBTemplate:Snd Packed average of unsigned bytePAVGWTemplate:Snd Packed average of unsigned wordPMAXSWTemplate:Snd Packed maximum signed wordPMAXUBTemplate:Snd Packed maximum unsigned bytePMINSWTemplate:Snd Packed minimum signed wordPMINUBTemplate:Snd Packed minimum unsigned bytePMULHUWTemplate:Snd Packed multiply high unsigned wordPSADBWTemplate:Snd Packed sum of absolute byte differencesPSHUFWTemplate:Snd Packed shuffle wordPEXTRWTemplate:Snd Extract word into integer registerPINSRWTemplate:Snd Insert word from integer registerPMOVMSKBTemplate:Snd Move byte mask to integer registerPREFETCHNTATemplate:Snd Prefetch using the NTA referencePREFETCHT0Template:Snd Prefetch using the T0 referencePREFETCHT1Template:Snd Prefetch using the T1 referencePREFETCHT2Template:Snd Prefetch using the T2 referenceSFENCETemplate:Snd Store fence
3DNow! Professional
3DNow! Professional is a trade name used to indicate processors that combine 3DNow! technology with a complete SSE instructions set (such as SSE, SSE2 or SSE3).<ref>Template:Cite web</ref> The Athlon XP was the first processor to carry the 3DNow! Professional trade name, and was the first product in the Athlon family to support the complete SSE instruction set (for the total of: 21 original 3DNow! instructions; five 3DNow! extension DSP instructions; 19 MMX extension instructions; and 52 additional SSE instructions for complete SSE compatibility).<ref>Template:Cite web</ref>
3DNow! and the Geode GX/LX
The Geode GX and Geode LX added two new 3DNow! instructions which is absent in all other processors.
3DNow! "professional" instructions unique to the Geode GX/LX are the following:
PFRSQRTVTemplate:Snd Reciprocal square root approximation for a pair of 32-bit floatsPFRCPVTemplate:Snd Reciprocal approximation for a pair of 32-bit floats
Advantages and disadvantages
One advantage of 3DNow! is that it is possible to add or multiply the two numbers that are stored in the same register. With SSE, each number can only be combined with a number in the same position in another register. This capability, known as horizontal in Intel terminology, was the major addition to the SSE3 instruction set.
A disadvantage with 3DNow! is that 3DNow! instructions and MMX instructions share the same register-file, whereas SSE adds 8 new independent registers (XMM0–XMM7).
Because MMX/3DNow! registers are shared by the standard x87 FPU, 3DNow! instructions and x87 instructions cannot be executed simultaneously. However, because it is aliased to the x87 FPU, the 3DNow! and MMX register states can be saved and restored by the traditional x87 F(N)SAVE and F(N)RSTOR instructions. This arrangement allowed operating systems to support 3DNow! with no explicit modifications, whereas SSE registers required explicit operating system support to properly save and restore the new XMM registers (via the added FXSAVE and FXRSTOR instructions.)
The FX* instructions from SSE provide a functional superset of the older x87 save and restore instructions. They can save not only SSE register states but also the x87 register states (hence are applicable also for MMX and 3DNow! operations where supported).
On AMD Athlon XP and K8-based cores (i.e. Athlon 64), assembly programmers have noted that it is possible to combine 3DNow! and SSE instructions to reduce register pressure, but in practice it is difficult to improve performance due to the instructions executing on shared functional units.<ref>Template:Cite newsgroup</ref>
Processors supporting 3DNow!
- All AMD processors after K6-2 (based on K6), Athlon, Athlon 64 and Phenom architecture families.
- National Semiconductor Geode GX2, later AMD Geode.
- VIA C3 (also known as Cyrix III) "Samuel", "Samuel 2", "Ezra", and "Eden ESP" cores.
- IDT WinChip 2, 3
References
Further reading
- Case, Brian (1 June 1998). "3DNow Boosts Non-Intel 3D Performance". Microprocessor Report.
- Oberman, S.; Favor, G.; Weber, F. (March 1999). "AMD 3DNow technology: architecture and implementations". IEEE Micro.
External links
- 3DNow Technology Partners, archived from the original (removed from AMD's website in early 2001)
- AMD 3DNow Instruction Porting Guide (PDF), archived from the original (removed from AMD's website in 2014)
- 3DNow Technology Manual
- AMD Extensions to the 3DNow and MMX Instruction Sets Manual
- AMD Geode LX Processors Data Book
- AMD 3DNow! SDK March 1999, archived