wwylele / teakra

DSi/3DS DSP emulator, disassembler, assembler, and tester
MIT License
76 stars 19 forks source link

Use compiler intrinsic to calculate mask #13

Closed jroweboy closed 5 years ago

jroweboy commented 5 years ago

Profiling showed that the naive caluclation of the bit mask was rather hot. The mask is just the first 2^n-1 larger than mod, which means an intrinsic that uses BSR on intel would be much faster. This shaves off around 5ms frametime when running the Pokemon X intro

Also adds a missing include to fix msvc compiling.

(I didn't test compiling on non msvc so please wait for CI to check them)

wwylele commented 5 years ago

Sorry that I went ahead to push the msvc compiling error fix because I want to restore the CI state for other changes. Please rebase

jroweboy commented 5 years ago

Updated and compiler warnings fixed. Please check that those fixes are to your liking

wwylele commented 5 years ago

Superseded by #33