Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Ahhh! That's genius! Reply to this message
Posted byfinaldave
Posted on12/16/03 05:16 AM



> > I'm thinking mainly of ARM, MIPS portable machines here by the way - x86 of
> > course for 68000 is done and dusted since Pentium 2s.
>
> 68K on a slow MIPS would suck. On ARM, it probably would, too, but I don't know
> how much because I don't know much about ARM's subtleties off the top of my
> head.
>
> X86 is nice because of the almost 1:1 flag mapping. What about ARM? ARM can
> automatically shift operands and supports conditional execution -- would that
> help in flag calculation and/or on-the-fly instruction decoding?
>
> I don't think anyone's even tried writing a hand-tuned 68K interpreter for ARM
> in assembly.

Actually I'm writing one at the moment called Cyclone, it's roughly 90% done.
Iirc it seems to run 68000 code at about 40-70Mhz on a 205Mhz Pocket PC without graphics but a lot less with. Also it's for 32-bit only, not Thumb sadly, because I just ran out of registers, and there's lots of handy conditional execution stuff you can't use on Thumb.

Thing is you have to wonder whether a threaded interpreter would have been more sensible, after all ARM might only last a couple more years with the PSP on the horizon! Ah well, could just finish one then do the other with the experienced learned
e.g. Never utter the words "Ah I'm sure no-one will ever use the fact that add.b 0x40,0x40 sets the negative bit!" :P In fact when writing an emulator you should never ever utter the words "Ah I'm sure no-one will ever use..." because rest assured someone ALWAYS uses it!

>
> > like this:
> > struct Opcode
> > {
> > void (*execute)(int currentPc); // Handler for executing the opcode, either
> > the flags version or not
> > char ra,rb; // Registers to use
> > };
> >
> > And then you allocate a new one for each unique opcode (e.g. move d0,d2 gets a
> > new Opcode structure, but following move d0,d2 opcodes point to the previous
> > one)
>
> Wouldn't that imply that you'd have to translate an instruction sequence into an
> array of pointers to Opcode structs? The idea you have, if I understand
> correctly, is that a lot of the same opcode structs would be used.
>
> But this adds a level of indirection and might even increase memory usage
> (because, realistically, how often is the same instance of a single instruction
> used?)
>
> > By the way... was there a name for this thing? It seems halfway between an
> > interpreting emulator and a recompiler...
>
> I think the term "threaded interpreter" still applies here. Or "pre-decoded
> interpreter", if you want -- that sounds descriptive.
>
> >Generator calls it a Dynarec, but it
> > doesn't quite seem to me that it is because it doesn't emit real code, only IL
> > code.
>
> It could generate real code to do the CALLs and parameter pushing if it wanted
> to.
>
>
> ----
> Bart
>


You learn something old everyday...


-
Entire Thread
Subject  Posted byPosted On
*Does Generator have a 68000 Dynarec?  finaldave12/10/03 03:35 PM
.*Re: Does Generator have a 68000 Dynarec?  Bart T.12/10/03 03:48 PM
..*Ahhh! That's genius!  finaldave12/11/03 05:03 AM
...*Re: Ahhh! That's genius!  smf12/12/03 07:56 AM
....*Re: Ahhh! That's genius!  ElSemi12/13/03 07:31 AM
.....*Re: Ahhh! That's genius!  finaldave12/13/03 05:19 PM
......*Re: Ahhh! That's genius!  Bart T.12/13/03 08:31 PM
.......*Re: Ahhh! That's genius!  ElSemi12/14/03 05:18 AM
........*Re: Ahhh! That's genius!  Riff12/15/03 00:38 AM
.........*Re: Ahhh! That's genius!  Bart T.12/15/03 01:17 AM
..........*Re: Ahhh! That's genius!  Riff12/15/03 02:27 PM
...........*Re: Ahhh! That's genius!  Bart T.12/16/03 03:20 AM
...........*Re: Ahhh! That's genius!  finaldave12/15/03 03:48 PM
............*Re: Ahhh! That's genius!  Bart T.12/15/03 04:30 PM
.............*Re: Ahhh! That's genius!  Kayamon12/18/03 08:56 AM
..............*Re: Ahhh! That's genius!  finaldave12/18/03 09:36 AM
...............*Re: Ahhh! That's genius!  smf12/19/03 04:33 AM
..............Re: Ahhh! That's genius!  finaldave12/16/03 05:16 AM
..............*Re: Ahhh! That's genius!  Bart T.12/16/03 01:04 PM
...............*Re: Ahhh! That's genius!  finaldave12/16/03 03:40 PM
................*Re: Ahhh! That's genius!  smf12/17/03 06:33 AM
.................*Re: Ahhh! That's genius!  finaldave12/17/03 06:39 AM
..................*Re: Ahhh! That's genius!  smf12/17/03 09:57 AM
...................*Re: Ahhh! That's genius!  finaldave12/17/03 12:39 PM
....................*Re: Ahhh! That's genius!  smf12/17/03 02:59 PM