A lot of modern CPUs and GPUs provide Single Instruction Multiple Data (SIMD) support. Four 32-bit data values (integers or floats) can be processed in parallel with the help of 128-bit special registers. This provides a potential speedup of 400 percent for image processing, 3D graphics, audio processing, and other numeric computation algorithms. Also, machine-learning algorithms (such as for automatic speech recognition) that use a Gauss Mixture Model (GMM) benefit from SIMD.
Dart lets you work with this feature by using the special SIMD x types from the typed_data
library. It offers the following four types:
Int32x4
, which represents four 32-bit integer valuesFloat32x4
, which represents four single-precision floating point valuesList structures to contain the 32-bit integer values, such as
Int32x4List
Float32x4List
, list structure to contain the 32-bit floating point values
Let's see some examples of SIMD operations in simd.dart
; the different...