RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.38k stars 247 forks source link

Add some AVX support #452

Closed KungFuJesus closed 2 months ago

KungFuJesus commented 4 years ago

This PR includes support for AVX for some of the more expensive functions in the profiler. I planned to vectorize many more functions but this fell off my plate. For now, this shows some measurable improvement (though I don't recall exactly how much - I remember the functions basically disappearing in perf after doing this).

RobertBeckebans commented 3 years ago

All intrinsic assembly functions need to be firewalled with #if defined( USE_INTRINSICS ) so they can be turned off by CMake.

So it should be


#if defined( USE_INTRINSICS )
    #if defined( __AVX__ )
    your code
    #else 
    id Software old SSE code
    #endif 
#endif