On Wed, Aug 26, 2009 at 12:57 PM, Gabe Black<[email protected]> wrote:
>> 1. Get StaticInst for PC X (if any).
>> 2. Read the StaticInst's ExtMachInst to learn that the original
>> instruction it represents occupied N bytes, and what those bytes were.
>> 3. Compare the N bytes in memory at PC X with the N bytes stored in
>> the ExtMachInst.
>>
>
> That mostly sounds reasonable in isolation, but either that's going to
> need to be a #ifed mechanism just for x86 (I don't like those at all) or
> all the other ISAs will have to go through the motions with little to no
> benefit.

Yes, I recognized that... I don't like ifdefs either, but this seems
like a spot where it could be justified.  If you don't like
special-casing for x86, we could consider this as just being two
different general-purpose mechanisms, one for ISAs with fixed-length
instructions and one for those with variable-length instructions :-).

> I do like the idea of reading in all the bytes at once, though.
> It would simplify the logic in the predecoder in that case. There would
> still need to be a version that figured out what bytes are needed if we
> miss, though, so we'd end up with two copies of it, one simplified and
> one regular.

I don't see this... you just do a straight byte compare (plus the
context info, as you indicated), and if there's a match you don't need
the predecoder at all.  If there's a miss, you still have to go
through the same predecode step you do now, but that's still only one
version.

> The changes in the decode structure would be
> significant assuming there isn't a "predecoded" format. [...]
> The decoder function as generated by the isa description doesn't allow
> for that.

The more I see what you've had to go through to get x86 working, the
more I feel like revisiting many aspects of the ISA description system
to clean up the process.  If that includes some different
specification of the decoder function then I'm open to that.

> I don't want to sound like this won't work with enough effort, but there
> will be significant challenges that may make it not worthwhile.

Yea, now that you have it working it is a shame to go rip things up...
at the same time, if you didn't have it working already, we probably
wouldn't know what we're up against and wouldn't be able to do it
right.

> Decoding
> x86 efficiently certainly deserves its reputation.

They spell that "competitive advantage" where I work ;-).

Steve
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to