Selection of libraries designed to be used with Emu projects. This was originally a Math library only, but has since been changed to hold all Emu libraries to enable consistency in changes to dependencies (such as EmuCore modifications).
Adds a FastVector type FastVector4f, which contains 4 floating-point elements, and makes use of SIMD intrinsic functions to optimise vector operations.
It should be noted that, although there is this explicit vector, a lot of optimisations may be performed by the compiler due to the inlined recursion of the base vector functionalities, so differences are not as drastic as one may expect.
In the test harness, many functionalities tested close to one another, with SIMD winning by several milliseconds overall in all cases. These results should, however, be taken with a grain of salt as they do not directly consider live differences, as all operations are performed contiguously and thus there may be significantly less cache misses (as an example) than in a live environment.
Despite this difference, this does offer a significant boost in debug mode compared to the normal vector. If a lot of time will be spent in debug mode, it is definitely beneficial to make use of these vectors.
Semantics with FastVector types are mostly identical to the base vector template, so choosing FastVector variants over the template will have minimal impact on code readability. Key differences include:
Random access is read-only
Functions offer significantly less templatised options; more often than not, the optional arguments are the vector's underlying SIMD register, the vector's type itself, and the contained type.
In FastVector4f's case, these arguments are: FastVector4f, __m128, and float.
Adds a FastVector type
FastVector4f
, which contains 4 floating-point elements, and makes use of SIMD intrinsic functions to optimise vector operations.It should be noted that, although there is this explicit vector, a lot of optimisations may be performed by the compiler due to the inlined recursion of the base vector functionalities, so differences are not as drastic as one may expect. In the test harness, many functionalities tested close to one another, with SIMD winning by several milliseconds overall in all cases. These results should, however, be taken with a grain of salt as they do not directly consider live differences, as all operations are performed contiguously and thus there may be significantly less cache misses (as an example) than in a live environment.
Semantics with FastVector types are mostly identical to the base vector template, so choosing FastVector variants over the template will have minimal impact on code readability. Key differences include:
FastVector4f
's case, these arguments are:FastVector4f
,__m128
, andfloat
.