This commit is contained in:
mcrcortex
2025-12-15 12:54:59 +10:00
parent b7f5798ecd
commit bbf7d60abe

View File

@@ -55,7 +55,11 @@ public class WorldUpdater {
final int iSecMsk1 = (~secMsk) + 1; final int iSecMsk1 = (~secMsk) + 1;
int secIdx = 0; int secIdx = 0;
//TODO: manually unroll and do e.g. 4 iterations per loop
//TODO rotate the loop parralelization
// i.e. instead of doing 4 consecutive blocks, which would all be in the same cache line
// do 4 seperate rows so they are in different cache lines, should allow
// more instruction pipelining (in theory)
for (int i = 0; i <= 0xFFF; i+=4) { for (int i = 0; i <= 0xFFF; i+=4) {
int cSecIdx = secIdx + baseSec; int cSecIdx = secIdx + baseSec;
secIdx = (secIdx + iSecMsk1) & secMsk; secIdx = (secIdx + iSecMsk1) & secMsk;