Re: [hatari-devel] Instruction cache misses and CPU cycles

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On lauantai 16 helmikuu 2013, Douglas Little wrote:
> On 15 February 2013 21:45, Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
> > Does this look even remotely right:
> > ---------
>> 
>> > d 0xe2f044
>> 
>> $e2f044 : 3f00            move.w  d0,-(sp)  0.31% (43303, 173268,
>> $e2f046 : 4eb9 00e2 fe7e  jsr     $e2fe7e   0.31% (43303, 433172,
>> $e2f04c : 548f            addq.l  #2,sp     0.31% (43303, 34,
>> $e2f04e : 4a80            tst.l   d0        0.31% (43303, 86692,
>> $e2f050 : 674a            beq.s   $e2f09c   0.31% (43303, 86666, 
---------
>> ?
> 
> There can't be fewer total cycles than visits so something is wrong
> there. However it's hard to tell from one instance if it's some sort of
> off-by-one problem or more complicated. Would need to watch what happens
> at lots of sites, and possibly on the first few visits to each affected
> site.

Old UAE core shows sane cycle values for same place (nearly same use-case):
--------------------------
> d 0xe2f044
$e2f044 : 3f00            move.w    d0,-(sp)   0.31% (49077, 196364, 0)
$e2f046 : 4eb9 00e2 fe7e  jsr       $e2fe7e    0.31% (49077, 491054, 0)
$e2f04c : 548f            addq.l    #2,sp      0.31% (49077, 196372, 0)
$e2f04e : 4a80            tst.l     d0         0.31% (49077, 98184, 0)
$e2f050 : 674a            beq.s     $e2f09c    0.31% (49077, 196420, 0)
--------------------------

And I've never seen it to complain about zero cycles, like happens
with WinUAE CPU core.


Cycles might "bleed" to next instruction from STOP instruction though:
--------------------------
WARNING: cycles 832 > 512 at 0xe015c6
....
> d 0xe015c0
$e015c0 : 4e75            rts       
$e015c2 : 4e72 2300       stop      #$2300     0.18% (49741, 1448002278, 0)
$e015c6 : 46c0            move      d0,sr      0.18% (49742, 299398, 0)
$e015c8 : 4e75            rts                  0.18% (49742, 398110, 0)
--------------------------

When looking at newcpu.c, do_specialties() can return from it
after STOP instruction without calling debugger.  That probably
needs to be fixed both in old and new CPU core.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/