From: Andy 'Krazy' Glew on
On 7/6/2010 5:07 PM, nedbrek wrote:
> Hello,
>>>> In other words, if the instructions are garbage, how much garbage is
>>>> taken in? What are the rules?
>>>>
>>>> My guess is, each possible opcode byte has something like a lookup
>>>> table entry, and after parsing a byte, the prefetcher either adds
>>>> another byte to the instruction, adds a modr/m byte to the instruction
>>>> and grabs displacement and immediate bytes, or ends the instruction
>>>> and sends it to the pipeline. This is entirely based on inference, I
>>>> can't find anything in the manuals to confirm or deny this.
>>>>
>>>> Whatever process it uses, it MUST be entirely deterministic, or code
>>>> can't be. So where is it documented?


By the way, stuff like this was documented, somewhat, in early processors such as the 8086. the manuals would say how
many instruction bytes had been prefetched, and you could deduce, from the manuals but also with a lot of
experimentation, that if did stuff like writing into precisely the next instruction it would not be seeen immediately
because that instruction had already been fetched.

People wrote code that depended on such behavior.

People wrote code that useed differences in such behavior to distinguish a 8086 from and 80286, etc.

Intel learned that it was bad to describe such model specific behavior in tooo much detail.

Over time, processors have gotten stricter and stricter, tending to implement "SMC immediattely", etc.