nfengine icon indicating copy to clipboard operation
nfengine copied to clipboard

Implement SSE/AVX code for Math module

Open lookeypl opened this issue 9 years ago • 1 comments

Math module in nfCommon uses purely SSE4 code. We need to take into account other CPU extension sets:

  • Implement no SSE/AVX version of Math module (should depend on NFE_MATH_USE_SSE macro)
  • Implement AVX and older SSE versions of Math modules (needs discussion which SSE versions should we use)
  • Upgrade current nfCommon Math tests to switch between SSE/AVX to test all available cases (this might require some code to discover available SSE version). Avoid code duplication.

lookeypl avatar Mar 10 '15 07:03 lookeypl

I'm afraid that we can't do "switching between SSE/AVX" at the runtime. Most of Vector class methods are implemented in the header and is inlined everywhere. Theoretically we could implement different versions (SSE/SSE4/AVX) of some "bigger" functions like intersection tests or matrix inversion and choose the best version in the runtime (via some function pointers table). However, this requires a discussion.

Witek902 avatar Mar 11 '15 09:03 Witek902