Misplaced Pages

Multimedia Acceleration eXtensions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

The Multimedia Acceleration eXtensions or MAX are instruction set extensions to the Hewlett-Packard PA-RISC instruction set architecture (ISA). MAX was developed to improve the performance of multimedia applications that were becoming more prevalent during the 1990s.

#382617

58-405: MAX instructions operate on 32- or 64-bit SIMD data types consisting of multiple 16-bit integers packed in general purpose registers . The available functionality includes additions, subtractions and shifts. The first version, MAX-1 , was for the 32-bit PA-RISC 1.1 ISA. The second version, MAX-2 , was for the 64-bit PA-RISC 2.0 ISA. The approach is notable because the set of instructions

116-511: A SIMD processor somewhere in its architecture. The PlayStation 2 was unusual in that one of its vector-float units could function as an autonomous DSP executing its own instruction stream, or as a coprocessor driven by ordinary CPU instructions. 3D graphics applications tend to lend themselves well to SIMD processing as they rely heavily on operations with 4-dimensional vectors. Microsoft 's Direct3D 9.0 now chooses at runtime processor-specific implementations of its own math operations, including

174-404: A SIMD processor there are two improvements to this process. For one the data is understood to be in blocks, and a number of values can be loaded all at once. Instead of a series of instructions saying "retrieve this pixel, now retrieve the next pixel", a SIMD processor will have a single instruction that effectively says "retrieve n pixels" (where n is a number that varies from design to design). For

232-527: A common operation in many multimedia applications. One example would be changing the brightness of an image. Each pixel of an image consists of three values for the brightness of the red (R), green (G) and blue (B) portions of the color. To change the brightness, the R, G and B values are read from memory, a value is added to (or subtracted from) them, and the resulting values are written back out to memory. Audio DSPs would likewise, for volume control, multiply both Left and Right channels simultaneously. With

290-485: A few "vector registers" that use the same interfaces across all CPUs with this instruction set. The hardware handles all alignment issues and "strip-mining" of loops. Machines with different vector sizes would be able to run the same code. LLVM calls this vector type "vscale". An order of magnitude increase in code size is not uncommon, when compared to equivalent scalar or equivalent vector code, and an order of magnitude or greater effectiveness (work done per instruction)

348-417: A powerful tool in real-time video processing applications like conversion between various video standards and frame rates ( NTSC to/from PAL , NTSC to/from HDTV formats, etc.), deinterlacing , image noise reduction , adaptive video compression , and image enhancement. A more ubiquitous application for SIMD is found in video games : nearly every modern video game console since 1998 has incorporated

406-402: A safe fallback mechanism on unsupported CPUs to simple loops. Instead of providing an SIMD datatype, compilers can also be hinted to auto-vectorize some loops, potentially taking some assertions about the lack of data dependency. This is not as flexible as manipulating SIMD variables directly, but is easier to use. OpenMP 4.0+ has a #pragma omp simd hint. This OpenMP interface has replaced

464-552: A single instruction without any overhead. This is similar to C and C++ intrinsics. Benchmarks for 4×4 matrix multiplication , 3D vertex transformation , and Mandelbrot set visualization show near 400% speedup compared to scalar code written in Dart. McCutchan's work on Dart, now called SIMD.js, has been adopted by ECMAScript and Intel announced at IDF 2013 that they are implementing McCutchan's specification for both V8 and SpiderMonkey . However, by 2017, SIMD.js has been taken out of

522-463: A slower cycle time than the 7600 (40 ns vs 27.5 ns). So the vector length needed for the STAR to run faster than the 7600 occurred at about 50 elements; if the loops were working on data sets with fewer elements, the time cost of setting up the vector pipeline was higher than the time savings provided by the vector instruction(s). When the machine was released in 1974, it quickly became apparent that

580-472: A successful model for the multimedia instructions of other CPU designs. The set is also small because the CPU already included powerful shift and bit-manipulation instructions: "Shift pair" which shifts a pair of registers, "extract" and "deposit" of bit fields, and all the common bit-wise logical operations (and, or, exclusive-or, etc.). This set of multimedia instructions has proven its performance, as well. In 1996

638-608: A time, using a hypercube-connected network or processor-dedicated RAM to find its operands. Supercomputing moved away from the SIMD approach when inexpensive scalar MIMD approaches based on commodity processors such as the Intel i860 XP became more powerful, and interest in SIMD waned. The current era of SIMD processors grew out of the desktop-computer market rather than the supercomputer market. As desktop processors became powerful enough to support real-time gaming and audio/video processing during

SECTION 10

#1732876681383

696-417: A variety of reasons, this can take much less time than retrieving each pixel individually, as with a traditional CPU design. Another advantage is that the instruction operates on all loaded data in a single operation. In other words, if the SIMD system works by loading up eight data points at once, the add operation being applied to the data will happen to all eight values at the same time. This parallelism

754-488: A wide set of nonstandard extensions, including Cilk 's #pragma simd , GCC's #pragma GCC ivdep , and many more. Consumer software is typically expected to work on a range of CPUs covering multiple generations, which could limit the programmer's ability to use new SIMD instructions to improve the computational performance of a program. The solution is to include multiple versions of the same code that uses either older or newer SIMD technologies, and pick one that best fits

812-559: Is achievable with Vector ISAs. ARM's Scalable Vector Extension takes another approach, known in Flynn's Taxonomy as "Associative Processing", more commonly known today as "Predicated" (masked) SIMD. This approach is not as compact as Vector processing but is still far better than non-predicated SIMD. Detailed comparative examples are given in the Vector processing page. Small-scale (64 or 128 bits) SIMD became popular on general-purpose CPUs in

870-415: Is common for publishers of the SIMD instruction sets to make their own C/C++ language extensions with intrinsic functions or special datatypes (with operator overloading ) guaranteeing the generation of vector code. Intel, AltiVec, and ARM NEON provide extensions widely adopted by the compilers targeting their CPUs. (More complex operations are the task of vector math libraries.) The GNU C Compiler takes

928-685: Is easier to achieve as only compiler switches need to be changed. Glibc supports LMV and this functionality is adopted by the Intel-backed Clear Linux project. In 2013 John McCutchan announced that he had created a high-performance interface to SIMD instruction sets for the Dart programming language, bringing the benefits of SIMD to web programs for the first time. The interface consists of two types: Instances of these types are immutable and in optimized code are mapped directly to SIMD registers. Operations expressed in Dart typically are compiled into

986-406: Is headed by computer architect Bill Dally . Their Storm-1 processor (2007) contains 80 SIMD cores controlled by a MIPS CPU. CDC STAR-100 The CDC STAR-100 is a vector supercomputer that was designed, manufactured, and marketed by Control Data Corporation (CDC). It was one of the first machines to use a vector processor to improve performance on appropriate scientific applications. It

1044-687: Is heavily SIMD based. Philips , now NXP , developed several SIMD processors named Xetal . The Xetal has 320 16-bit processor elements especially designed for vision tasks. Intel's AVX-512 SIMD instructions process 512 bits of data at once. SIMD instructions are widely used to process 3D graphics, although modern graphics cards with embedded SIMD have largely taken over this task from the CPU. Some systems also include permute functions that re-pack elements inside vectors, making them particularly useful for data processing and compression. They are also used in cryptography. The trend of general-purpose computing on GPUs ( GPGPU ) may lead to wider use of SIMD in

1102-424: Is much smaller than in other multimedia CPUs, and also more general-purpose. The small set and simplicity of the instructions reduce the recurring costs of the electronics, as well as the costs and difficulty of the design. The general-purpose nature of the instructions increases their overall value. These instructions require only small changes to a CPU's arithmetic-logic unit. A similar design approach promises to be

1160-440: Is separate from the parallelism provided by a superscalar processor ; the eight values are processed in parallel even on a non-superscalar processor, and a superscalar processor may be able to perform multiple SIMD operations in parallel. To remedy problems 1 and 5, RISC-V 's vector extension uses an alternative approach: instead of exposing the sub-register-level details to the programmer, the instruction set abstracts them out as

1218-585: The Cray-1 (1977). The first era of modern SIMD computers was characterized by massively parallel processing -style supercomputers such as the Thinking Machines CM-1 and CM-2 . These computers had many limited-functionality processors that would work in parallel. For example, each of 65,536 single-bit processors in a Thinking Machines CM-2 would execute the same instruction at the same time, allowing, for instance, to logically combine 65,536 pairs of bits at

SECTION 20

#1732876681383

1276-697: The FPU and MMX registers . Compilers also often lacked support, requiring programmers to resort to assembly language coding. SIMD on x86 had a slow start. The introduction of 3DNow! by AMD and SSE by Intel confused matters somewhat, but today the system seems to have settled down (after AMD adopted SSE) and newer compilers should result in more SIMD-enabled software. Intel and AMD now both provide optimized math libraries that use SIMD instructions, and open source alternatives like libSIMD , SIMDx86 and SLEEF have started to appear (see also libm ). Apple Computer had somewhat more success, even though they entered

1334-565: The stream unit . The stream unit accesses the main memory through the SAC via three 128-bit data buses, two for reads, and one for writes. There is also a 128-bit data bus for instruction fetch, I/O, and control vector access. The stream unit serves as the control unit, fetching and decoding instructions, initiating memory accesses on the behalf of the pipelined functional units, and controlling instruction execution, among other tasks. It also contains two read buffers and one write buffer for streaming data to

1392-479: The 1990s, demand grew for this particular type of computing power, and microprocessor vendors turned to SIMD to meet the demand. Hewlett-Packard introduced MAX instructions into PA-RISC 1.1 desktops in 1994 to accelerate MPEG decoding. Sun Microsystems introduced SIMD integer instructions in its " VIS " instruction set extensions in 1995, in its UltraSPARC I microprocessor. MIPS followed suit with their similar MDMX system. The first widely deployed desktop SIMD

1450-545: The 64-bit "MAX-2" instructions enabled real-time performance of MPEG-1 and MPEG-2 video while increasing the area of a RISC CPU by only 0.2%. MAX-1 was first implemented with the PA-7100LC in 1994. It is usually attributed as being the first SIMD extensions to an ISA. The second version, MAX-2 , was for the 64-bit PA-RISC 2.0 ISA. It was first implemented in the PA-8000 microprocessor released in 1996. The basic approach to

1508-456: The 7600 to emulate the vector operations of the STAR. In the process of developing STACKLIB, they found that programs converted to use it ran faster than they had before, even on the 7600. This placed further pressures on the performance of the STAR. The STAR-100 was a disappointment to everyone involved. Jim Thornton , formerly Seymour Cray 's close assistant on the CDC 1604 and 6600 projects and

1566-565: The ECMAScript standard queue in favor of pursuing a similar interface in WebAssembly . As of August 2020, the WebAssembly interface remains unfinished, but its portable 128-bit SIMD feature has already seen some use in many engines. Emscripten, Mozilla's C/C++-to-JavaScript compiler, with extensions can enable compilation of C++ programs that make use of SIMD intrinsics or GCC-style vector code to

1624-550: The GCC extension. LLVM's libcxx seems to implement it. For GCC and libstdc++, a wrapper library that builds on top of the GCC extension is available. Microsoft added SIMD to .NET in RyuJIT. The System.Numerics.Vector package, available on NuGet, implements SIMD datatypes. Java also has a new proposed API for SIMD instructions available in OpenJDK 17 in an incubator module. It also has

1682-570: The SIMD API of JavaScript, resulting in equivalent speedups compared to scalar code. It also supports (and now prefers) the WebAssembly 128-bit SIMD proposal. It has generally proven difficult to find sustainable commercial applications for SIMD-only processors. One that has had some measure of success is the GAPP , which was developed by Lockheed Martin and taken to the commercial sector by their spin-off Teranex . The GAPP's recent incarnations have become

1740-540: The SIMD market later than the rest. AltiVec offered a rich system and can be programmed using increasingly sophisticated compilers from Motorola , IBM and GNU , therefore assembly language programming is rarely needed. Additionally, many of the systems that would benefit from SIMD were supplied by Apple itself, for example iTunes and QuickTime . However, in 2006, Apple computers moved to Intel x86 processors. Apple's APIs and development tools ( XCode ) were modified to support SSE2 and SSE3 as well as AltiVec. Apple

1798-434: The STAR's generally complex architecture, was implemented with microcode . Main memory had a capacity of 65,536 512-bit words , called superwords (SWORDs). Main memory was 32-way interleaved to pipeline memory accesses. It was constructed from core memory with an access time of 1.28 Îžs. The main memory was accessed via a 512-bit bus, controlled by the storage access controller (SAC), which handled requests from

Multimedia Acceleration eXtensions - Misplaced Pages Continue

1856-485: The arithmetic in MAX-2 is to "interrupt the carries" between the 16-bit subwords, and choose between modular arithmetic, signed and unsigned saturation. This requires only small changes to the arithmetic logic unit. MAX-2 instructions are register-to-register instructions that operate on multiple integers in 64-bit quantities. All have a one cycle latency in the PA-8000 microprocessor and its derivatives. Memory accesses are via

1914-496: The chief designer of STAR, left CDC to form Network Systems Corporation . An updated version of the basic architecture was later released in 1979 as the Cyber 203 , followed by the Cyber 205 in 1980, but by this point systems from Cray Research with considerably higher performance were on the market. The failure of the STAR led to CDC being pushed from its former dominance in the supercomputer market, something they tried to address with

1972-418: The code to "clone" functions, while ICC does so automatically (under the command-line option /Qax ). The Rust programming language also supports FMV. The setup is similar to GCC and Clang in that the code defines what instruction sets to compile for, but cloning is manually done via inlining. As using FMV requires code modification on GCC and Clang, vendors more commonly use library multi-versioning: this

2030-594: The early 1990s and continued through 1997 and later with Motion Video Instructions (MVI) for Alpha . SIMD instructions can be found, to one degree or another, on most CPUs, including IBM 's AltiVec and SPE for PowerPC , HP 's PA-RISC Multimedia Acceleration eXtensions (MAX), Intel 's MMX and iwMMXt , SSE , SSE2 , SSE3 SSSE3 and SSE4.x , AMD 's 3DNow! , ARC 's ARC Video subsystem, SPARC 's VIS and VIS2, Sun 's MAJC , ARM 's Neon technology, MIPS ' MDMX (MaDMaX) and MIPS-3D . The IBM, Sony, Toshiba co-developed Cell Processor 's SPU 's instruction set

2088-415: The execution units. The STAR-100 has two arithmetic pipelines. The first has a floating point adder and multiplier, and the second can execute all scalar instructions. It also contains a floating point adder, multiplier, and divider. Both pipelines are 64-bit for floating point operations and are controlled by microcode. The STAR-100 can split its floating point pipelines into four 32-bit pipelines, doubling

2146-506: The extensions a step further by abstracting them into a universal interface that can be used on any platform by providing a way of defining SIMD datatypes. The LLVM Clang compiler also implements the feature, with an analogous interface defined in the IR. Rust's packed_simd crate (and the experimental std::sims ) uses this interface, and so does Swift 2.0+. C++ has an experimental interface std::experimental::simd that works similarly to

2204-465: The future. Adoption of SIMD systems in personal computer software was at first slow, due to a number of problems. One was that many of the early SIMD instruction sets tended to slow overall performance of the system due to the re-use of existing floating point registers. Other systems, like MMX and 3DNow! , offered support for data types that were not interesting to a wide audience and had expensive context switching instructions to switch between using

2262-451: The general performance was disappointing. Very few programs can be effectively vectorized into a series of single instructions; nearly all calculations will rely on the results of some earlier instruction, yet the results had to clear the pipelines before they could be fed back in. This forced most programs to pay the high setup cost of the vector units, and generally the ones that did "work" were extreme examples. Worse, basic scalar performance

2320-470: The ground up with no separate scalar registers. Ziilabs produced an SIMD type processor for use on mobile devices, such as media players and mobile phones. Larger scale commercial SIMD processors are available from ClearSpeed Technology, Ltd. and Stream Processors, Inc. ClearSpeed 's CSX600 (2004) has 96 cores each with two double-precision floating point units while the CSX700 (2008) has 192. Stream Processors

2378-459: The machine meant that its real-world performance was much lower than expected when first used commercially in 1974, and was one of the primary reasons CDC was pushed from its former dominance in the supercomputer market when the Cray-1 was announced in 1975. Only three STAR-100 systems were delivered, two to LLNL and another to NASA Langley Research Center . The STAR had a 64-bit architecture , consisting of 195 instructions . Its main innovation

Multimedia Acceleration eXtensions - Misplaced Pages Continue

2436-428: The newer architectures are then considered "short-vector" architectures, as earlier SIMD and vector supercomputers had vector lengths from 64 to 64,000. A modern supercomputer is almost always a cluster of MIMD computers, each of which implements (short-vector) SIMD instructions. An application that may take advantage of SIMD is one where the same value is being added to (or subtracted from) a large number of data points,

2494-399: The peak performance of the system to 100 MFLOPS at the expense of half the precision. The STAR-100 uses I/O processors to offload I/O from the CPU. Each I/O processor is a 16-bit minicomputer with its own main memory of 65,536 words of 16 bits each, which is implemented with core memory. The I/O processors all share a 128-bit data bus to the SAC. The STAR-100's real-world performance

2552-436: The performance of multimedia use. SIMD has three different subcategories in Flynn's 1972 Taxonomy , one of which is SIMT . SIMT should not be confused with software threads or hardware threads , both of which are task time-sharing (time-slicing). SIMT is true simultaneous parallel hardware-level execution. Modern graphics processing units (GPUs) are often wide SIMD implementations. The first use of SIMD instructions

2610-478: The previous ones. As with instruction pipelines in general, the time needed to complete any one instruction was no better than it was before, but since the CPU is working on a number of data points at once, the overall performance dramatically improves. Many of the STAR's instructions were complex, especially the vector macro instructions, which performed complex operations that normally would have required long sequences of instructions. These instructions, along with

2668-484: The same operation on multiple data points simultaneously. Such machines exploit data level parallelism , but not concurrency : there are simultaneous (parallel) computations, but each unit performs the exact same instruction at any given moment (just with different data). SIMD is particularly applicable to common tasks such as adjusting the contrast in a digital image or adjusting the volume of digital audio . Most modern CPU designs include SIMD instructions to improve

2726-590: The standard 64-bit loads and stores. The "MIX" and "PERMH" instructions are a notable innovation because they permute words in the register set without accessing memory. This can substantially speed many operations. SIMD Single instruction, multiple data ( SIMD ) is a type of parallel processing in Flynn's taxonomy . SIMD can be internal (part of the hardware design) and it can be directly accessible through an instruction set architecture (ISA), but it should not be confused with an ISA. SIMD describes computers with multiple processing elements that perform

2784-596: The use of SIMD-capable instructions. A later processor that used vector processing is the Cell Processor used in the Playstation 3, which was developed by IBM in cooperation with Toshiba and Sony . It uses a number of SIMD processors (a NUMA architecture, each with independent local store and controlled by a general purpose CPU) and is geared towards the huge datasets required by 3D and video processing applications. It differs from traditional ISAs by being SIMD from

2842-482: The user's CPU at run-time ( dynamic dispatch ). There are two main camps of solutions: FMV, manually coded in assembly language, is quite commonly used in a number of performance-critical libraries such as glibc and libjpeg-turbo. Intel C++ Compiler , GNU Compiler Collection since GCC 6, and Clang since clang 7 allow for a simplified approach, with the compiler taking care of function duplication and selection. GCC and clang requires explicit target_clones labels in

2900-408: Was virtual . The vector instructions fed an arithmetic pipeline ; a single instruction could add two variable-length vectors of up to 65,535 elements with just one instruction fetch. The STAR also fetched vector operands in 512-bit units (superwords), reducing average memory latency. Since the memory location of the "next" operand is known, the CPU can fetch the next operands while it is operating on

2958-408: Was a fraction of its theoretical performance for a number of reasons. Firstly, the vector instructions, being "memory-to-memory," had a relatively long startup time, since the pipeline from the memory to the functional units was very long. In contrast to the register-based pipelined functional units in the 7600, the STAR pipelines were much deeper. The problem was compounded by the fact that the STAR had

SECTION 50

#1732876681383

3016-458: Was also the first supercomputer to use integrated circuits and the first to be equipped with one million words of computer memory . STAR is a blend of ST rings (of binary digits) and AR rays. The 100 alludes to the nominal peak processing speed of 100 million floating point operations per second ( MFLOPS ); the earlier CDC 7600 provided peak performance of 36 MFLOPS but more typically ran at around 10 MFLOPS. The design

3074-692: Was in the ILLIAC IV , which was completed in 1966. SIMD was the basis for vector supercomputers of the early 1970s such as the CDC Star-100 and the Texas Instruments ASC , which could operate on a "vector" of data with a single instruction. Vector processing was especially popularized by Cray in the 1970s and 1980s. Vector processing architectures are now considered separate from SIMD computers: Duncan's Taxonomy includes them whereas Flynn's Taxonomy does not, due to Flynn's work (1966, 1972) pre-dating

3132-424: Was part of a bid made to Lawrence Livermore National Laboratory (LLNL) in the mid-1960s. Livermore was looking for a partner who would build a much faster machine on their own budget and then lease the resulting design to the lab. It was announced publicly in the early 1970s, and on 17 August 1971, CDC announced that General Motors had placed the first commercial order for it. A number of basic design features of

3190-526: Was sacrificed to improve vector performance. Any time that the program had to run scalar instructions, the overall performance of the machine dropped dramatically. (See Amdahl's Law .) Two STAR-100 systems were eventually delivered to the Lawrence Livermore National Laboratory and one to NASA Langley Research Center . In preparation for the STAR deliveries, LLNL programmers developed a library of subroutines , called STACKLIB , on

3248-594: Was the dominant purchaser of PowerPC chips from IBM and Freescale Semiconductor . Even though Apple has stopped using PowerPC processors in their products, further development of AltiVec is continued in several PowerPC and Power ISA designs from Freescale and IBM. SIMD within a register , or SWAR , is a range of techniques and tricks used for performing SIMD in general-purpose registers on hardware that does not provide any direct support for SIMD instructions. This can be used to exploit parallelism in certain algorithms even on hardware that does not support SIMD directly. It

3306-567: Was the inclusion of 65 vector instructions for vector processing . The operations performed by these instructions were strongly influenced by concepts and operators from the APL programming language; in particular, the concept of "control vectors" (vector masks in modern terminology), and several instructions for vector permutation with control vectors, were carried over directly from APL. The vector instructions operated on vectors that were stored in consecutive locations in main memory; memory addressing

3364-903: Was with Intel's MMX extensions to the x86 architecture in 1996. This sparked the introduction of the much more powerful AltiVec system in the Motorola PowerPC and IBM's POWER systems. Intel responded in 1999 by introducing the all-new SSE system. Since then, there have been several extensions to the SIMD instruction sets for both architectures. Advanced vector extensions AVX, AVX2 and AVX-512 are developed by Intel. AMD supports AVX, AVX2 , and AVX-512 in their current products. All of these developments have been oriented toward support for real-time graphics, and are therefore oriented toward processing in two, three, or four dimensions, usually with vector lengths of between two and sixteen words, depending on data type and architecture. When new SIMD architectures need to be distinguished from older ones,

#382617