At 09:16 PM 9/19/2001 -0400, Gregor N. Purdy wrote:


> > > -    print INTERP "\tx[$opcodes{$name}{CODE}] = (void*)$name; \\\n";
> > > -}
> > > -print INTERP "} while (0);\n";
> > > +    printf INTERP "    { (void *)%-12s, %-14s, %d, { ",
> > > +   $name, "\"$name\"", $opcodes{$name}{ARGS};
> >
> > This is so much more confusing. :(
>
>It may be a little less clear to read the code, but the output is so much
>more readable in the generated file. A good trade-off in my book (my book
>allows printf :-)

People will generally be reading the code, not the output in the generated 
file. I'd prefer to optimize readability in the core files as opposed to 
the generated ones when we have to choose.

> > > +#define DO_OP(PC,INTERP) PC = 
> ((INTERP->opcode_info)[*PC].func)(PC,INTERP);
> >
> > I'm highly unconvinced that this is as portable as you'd like to think 
> it is.
>
>Yeah. I'm not a portability guru. Obviously the meaning is the same to a
>human C programmer and we remove the (explicit) temporaries. I think this
>is more *redable*, but I can't speek to whether it is equally
>*compilable*. I don't see any reason why it wouldn't be, but as I said,
>I don't know all there is to know about portability when it comes to stuff
>like this. I'm hoping to learn, though, if someone tries it and they tell
>me how it barfs.

Odds are the temps are irrelevant to the ultimate code speed. Any compiler 
worth its salt will optimize them properly, and the ones that suck, well, 
there's not much we can do about that. :)


                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to