According to Michael J. Flynn's taxonomy stands SIMD for Single Instruction, Multiple Data; also colloquially called as vector instructions. An application that may take advantage of SIMD is one where the same value is being added or subtracted to a large number of data points, a common operation in many multimedia applications.
With 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 get this pixel, now get the next pixel, a SIMD processor will have a single instruction that effectively says get lots of pixels. For a variety of reasons, this can take much less time than getting each pixel individually, like with traditional CPU design. Some common SIMD extensions are MMX, 3DNow!, SSE, and AltiVec (related to VMX).
On the other hand, we’re living no longer in the 8086 era; it seems that the 80386 is also history. We’ve now the Pentium II, III or IV, the Centrino technology, the Athlon, the Opteron etc. with several deep instruction pipelines, branch prediction, out of order execution, concurrent processing, powerful MMX and SSE instructions, and last but not least multiple processor cores. That is state of the art. But how can we use this features when it comes to programs?
Currently, implementing an algorithm with SIMD instructions usually requires human labor; most compilers don't generate SIMD instructions from a typical high level language program. Vectorization in compilers is an active area of computer science research. As a first step, I've uploaded the file SIMD.ZIP under the description Vectorization with SIMD instructions into the PB file base (Download). It can be accessed under http://www.powerbasic.com/support/do.../assembler.htm or
http://www.powerbasic.com/support/downloads/dos.htm.
SIMD.ZIP is Free Software under the GPL (General Public License); please check http://www.gnu.org/copyleft/gpl.html. All sources are included. Although the package contents at the present time only PB/DOS programs, it should be easy to implement the underlying ideas into PB/Win and PB/CC.
At the moment, there are only two ways for using SIMD instructions with PowerBASIC: Using inline assembly, and making separate assembly language modules. What could be the future? Some C++ compilers have support for the so-called intrinsic functions. Most of the intrinsic functions generate one machine instruction each. It's therefore equivalent to an assembly language instruction.
Coding with intrinsic functions is a kind of high-level assembly. It can easily be combined with high level language constructs such as IF-statements, loops, functions, classes and operator overloading. The invention of intrinsic functions has made it much easier to do programming tasks that previously required coding with assembly language syntax.
The main advantage is: There's no need to learn assembly language. But such intrinsic functions for PowerBASIC are currently not available and must be written, perhaps as a result of a programming project. Any feedback is appreciated.
Gunther
Encoding Team
With 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 get this pixel, now get the next pixel, a SIMD processor will have a single instruction that effectively says get lots of pixels. For a variety of reasons, this can take much less time than getting each pixel individually, like with traditional CPU design. Some common SIMD extensions are MMX, 3DNow!, SSE, and AltiVec (related to VMX).
On the other hand, we’re living no longer in the 8086 era; it seems that the 80386 is also history. We’ve now the Pentium II, III or IV, the Centrino technology, the Athlon, the Opteron etc. with several deep instruction pipelines, branch prediction, out of order execution, concurrent processing, powerful MMX and SSE instructions, and last but not least multiple processor cores. That is state of the art. But how can we use this features when it comes to programs?
Currently, implementing an algorithm with SIMD instructions usually requires human labor; most compilers don't generate SIMD instructions from a typical high level language program. Vectorization in compilers is an active area of computer science research. As a first step, I've uploaded the file SIMD.ZIP under the description Vectorization with SIMD instructions into the PB file base (Download). It can be accessed under http://www.powerbasic.com/support/do.../assembler.htm or
http://www.powerbasic.com/support/downloads/dos.htm.
SIMD.ZIP is Free Software under the GPL (General Public License); please check http://www.gnu.org/copyleft/gpl.html. All sources are included. Although the package contents at the present time only PB/DOS programs, it should be easy to implement the underlying ideas into PB/Win and PB/CC.
At the moment, there are only two ways for using SIMD instructions with PowerBASIC: Using inline assembly, and making separate assembly language modules. What could be the future? Some C++ compilers have support for the so-called intrinsic functions. Most of the intrinsic functions generate one machine instruction each. It's therefore equivalent to an assembly language instruction.
Coding with intrinsic functions is a kind of high-level assembly. It can easily be combined with high level language constructs such as IF-statements, loops, functions, classes and operator overloading. The invention of intrinsic functions has made it much easier to do programming tasks that previously required coding with assembly language syntax.
The main advantage is: There's no need to learn assembly language. But such intrinsic functions for PowerBASIC are currently not available and must be written, perhaps as a result of a programming project. Any feedback is appreciated.
Gunther
Encoding Team
Comment