Re: [hatari-devel] Issues with cache hits/misses?

[ Thread Index | Date Index | More Archives ]

Le 31/05/2015 23:35, Nicolas Pomarède a écrit :

I don't know yet, but we can clearly see that even during the early
memory tests at boot in falcon mode, the screen refresh is very slow (we
see red and yellow Atari logo, because all 4 planes are not copied fast
enough to get the 'black' color in one go).
So, this looks more like a 10 times slowdown than just a 10-20% overhead.

I made more tests in falcon mode, and the big part of the slow down comes from this in read_dcache030 :

        // only one long fetch needed?
        if (size == 0) {
//                                return get_byte (addr+aligned);
                v1 >>= (3 - aligned) * 8;
                return v1;
        } else if (size == 1 && aligned <= 2) {
//                                return get_word (addr+aligned);
                v1 >>= (2 - aligned) * 8;
                return v1;

In most cases, when just opening one of the top menu in the desktop gem, the data read from the cache are mostly bytes and aligned words.

If I bypass the "v1 >> .... * 8" line and do a return of the data immediately, emulation is nearly as fast as when 68030 cached is disabled.

But it seems that the right shift to extract the correct byte/word from the long word is taking a huge time (even with gcc -O3). Maybe some more recent cpu are better at doing right shift, but I would have expected it took only 1 cycle (in my case, it's an intel core 2 duo @ 3 GHz)

Maybe by splitting this line in several sub-parts it will be faster, could be gcc that does bad optimisations.


Mail converted by MHonArc 2.6.19+