1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 13:33:02 +01:00

Add a note about low-hanging optimisation fruit

This commit is contained in:
Michał Janiszewski
2016-02-15 00:17:15 +01:00
parent f447b9665a
commit 016d26976e

View File

@@ -162,6 +162,10 @@ int bitscanforward(int source)
int success = __builtin_ffs(source);
return success - 1;
#else
#pragma message "Falling back to iterative bitscan forward, consider using intrinsics"
// This is a low-hanging optimisation boost, check if your compiler offers
// any intrinsic.
// cf. https://github.com/OpenRCT2/OpenRCT2/pull/2093
for (i = 0; i < 32; i++)
if (source & (1u << i))
return i;