qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [ADD] PPC processor emulation


From: Jocelyn Mayer
Subject: Re: [Qemu-devel] [ADD] PPC processor emulation
Date: 18 Nov 2003 15:59:58 +0100

On Tue, 2003-11-18 at 13:24, Gwenole Beauchesne wrote: 
> On Tue, 18 Nov 2003, J. Mayer wrote:
> 
> > > I have a test program that covers around 600K variants with specific
> > > values to trigger flags updates. It requires a PPC host for now to
> > > validate results. It helped a lot to first write a correct interpreter and
> > > discover some hidden semantics in rare cases.
> > > 
> > The program, ppc_test does this with a lot of different instruction,
> > using a huge set of values. With the ctrace program, I could check that
> > it runs the same on my Ibook and on my PC with qemu. Where could I find
> > yours to make more tests ?
> 
> An oldish version is available here:
> <http://down.physik.uni-mainz.de/cgi-bin/viewcvs.cgi/SheepShaver/src/kpx_cpu/src/test/test-powerpc.cpp>
> 
> I will commit a newer version tonight. The "JIT1" engine is not committed
> yet either.

Well, I'll take a look... and 'll try qemu with this test !

> > You found hidden semantics, as you say. What is confusing, also, is that
> > Motorola's implementation isn't the same than IBM's one for some strange
> > cases...
> 
> Nevermind, you got divw implementation right at first sight, so forget 
> about it. ;-)

There are some strange things with string and load/store multiples too:
IBM allows the memory operand to be in the range of loaded registers as
Motorolla says this is invalid. IBM says this reg won't be modified. I'm
sure my implementation is false for both point of vues !

> > My TBL/TBU implementation isn't a real time clock, but is a cycle
> > counter, as on "real" PPC.
> 
> Doesn't a real PPC increments TBR after a time comparable to at least 4 
> addi instructions? I think there was an Apple TN# about it.

In fact, I though the spec said that it increments at each clock tick,
but I just checked and I see: "The VEA does not specify a relathionship between
the frequency at which the time base is updated and other clocks, such as
the processor clock. The TB update frequency is not required to be constant;
... one of two things is required:
* the system provides an implementation dependant exception to software whenever
  the update frequency of the time base changes and a means to determine the
  current update frequency
or
* the system software controls the update frequency of the time base"

So things aren't so simple... I wonder if MacOS would run on all PPCs...


-- 

Jocelyn Mayer <address@hidden>

Never organized





reply via email to

[Prev in Thread] Current Thread [Next in Thread]