On Tue, Apr 24, 2012 at 12:44 PM, Gabe Black <[email protected]> wrote:
> On 04/24/12 09:19, Steve Reinhardt wrote:
> >> Besides that, though, you're saying that the custom language is more
> >> concise than doing things in python.
> >
> > It certainly is for Alpha. I can believe that it's not the case (or at
> > least that the difference is not as significant) for x86 and ARM.
>
> This is a question, not a statement :-P.
Grammatically, they all look like statements to me.
> I don't think it's certainly
> true for Alpha either, although I have no concrete evidence either way.
>
You could come pretty close, perhaps, but the custom language is definitely
more concise.
For example, here's addq:
0x20: addq({{ Rc = Ra + Rb_or_imm; }});
Following your example, and skipping the creation of a separate class for
each instruction, you could do it in pure python as:
0x20: IntegerOperate('addq', 'Rc = Ra + Rb_or_imm;')
which is pretty good, but you'd still have some redundancy, and some things
that used to fit on one line would now be two, etc.
Though if I had to do it that way, I'd probably rename IntegerOperate to
IntOp.
If you want to say that the minor decrease in redundancy isn't worth the
overhead of the custom language, though, at this point I wouldn't
necessarily put up a fight.
Yeah, inverting things so that python is the primary language doesn't
> mean the other stuff has to go away. It could live inside the ISA
> description script just like the python let blobs live in the ISA
> description today. That's actually a good way to get the best of both
> worlds where you get the conciseness (if it really is more concise) or
> the flexibility, whichever you need more.
>
If you're really using python as the primary language, particularly for the
decode block, then is the ISA description language really buying you
anything? If we're seriously going to go this direction, I'd prefer to see
it such that you could do the whole code generation process in pure python,
with the current language being an optional front end that some ISAs can
use to drive the python... as I said, maybe more for backwards
compatibility than anything else.
Steve
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev