29 | | As a consequence, we will support exactly one vector length for each scalar data type and this vector length is dependent on the target architecture. Hence, it is sufficient to have one vector type for each scalar data type (that we want to process with SIMD instructions). Concretely, for types, such as `Int16#`, `Float#`, and so on, we will provide SIMD vector types `Int16Vec#`, `FloatVec#`, etc. In addition, we have query functions `int16VecLen`, `floatVecLen`, and so on that yield the number of `Int16#` in a `Int16Vec#` and the number of `Float#` in a `FloatVec#`, respectively. |
| 29 | As a consequence, we will support exactly one vector length for each scalar data type and this vector length is dependent on the target architecture. Hence, it is sufficient to have one vector type for each scalar data type (that we want to process with SIMD instructions). Concretely, for types, such as `Int#`, `Float#`, and so on, we will provide SIMD vector types `IntVec#`, `FloatVec#`, etc. In addition, we have constants `intVecLen`, `floatVecLen`, and so on that determine the number of `Int#` in a `IntVec#` and the number of `Float#` in a `FloatVec#`, respectively. |
| 37 | |
| 38 | We use the following API extension for `GHC.Prim`. Due to the odd manner in which sized integral types are implemented in `primops.txt.pp` (see heading "The word size story."), we need to introduce vector type for scalar types that do not exist as unboxed types in `GHC.Prim`. We obviously can't use "[t]he word size story" for SIMD vectors as they are packed, unboxed data types. |
| 39 | |
| 40 | === Types === |
| 41 | |
| 42 | SIMD vector types: `IntVec#`, `Int8Vec#`, `Int16Vec#`, `Int32Vec#`, `Int64Vec#`, `WordVec#`, `Word8Vec#`, `Word16Vec#`, `Word32Vec#`, `Word64Vec#`, `FloatVec#`, and `DoubleVec#`. |
| 43 | |
| 44 | Vector length constants: `intVecLen`, `intVec8Len`, `intVec16Len`, `intVec32Len`, `intVec64Len`, `wordVecLen`, `wordVec8Len`, `wordVec16Len`, `wordVec32Len`, `wordVec64Len`, `floatVecLen`, and `doubleVecLen`. Each of these constants is of type `Int#`. |