----- Original Message -----
From: Si Owen <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: 22. dubna 1999 16:41
Subject: RE: Win32 SimCoupe (was: Z80 flags for INI(R) and OTI(R)? #2
(oops!))
> Aley Keprt wrote:
> > I can't imagine the situation, where unions are inefficient.
> > Go and try it and you will see.
> > The Z80 emulator I use in my programs use unions and it looks very
> > efficient.
>
> I've done it already and it didn't actually seem to make much difference
to
> the performance from my tests. I've changed it to handle HL, IX and IY
the
> same way now too, instead of as separate special cases in each instruction
> that used them, and that didn't make a whole lot of difference either from
> what I can see (it does neaten it up a lot tho).
>
> Si
>
>
Well,
unions as well as flags looking-up tables can help much.
Obviously you can hardly see any difference on Pentium 2, when the CPU is
pretty fast. But you can get more on slower machines (486 etc.).
I think you should look to 486's when comparing all possible realisations,
because the SimCoupe is really fast enough on Pentium 2. But some people
really have slower machines, and THEY want it to run faster, not we, when we
have Celerons.
I think tables can't eat more memory than code. If we count 1000
instructions of Z80 and each of them would have it's own flag computing
code, it takes at least 10000 bytes. (+/-) If some instructions don't change
flags, let we say 5000 bytes.
Tables don't eat more than 1000 bytes and make speed-ups mainly on slower
machines.
I really don't see any disadvantage.
You wrote about some memory taken by those tables.
But it seems that code we could remove when using tables could be even
longer than those tables. Especially when assembler is always 32bit, but
flag look-up tables are 8bit.
I have experience with MOD players, when doing things like I said makes
GREAT speed-ups. That's why I think it could help us in SimCoupe too.
----------------------------------------------------------------
Aley [eili] Keprt - student, programmer (multimedia soft. etc.)
phone: +420-68-538 70 35
e-mail: [EMAIL PROTECTED] *** http://get.to/aley
----------------------------------------------------------------