Article: AMD's Mobile Strategy
By: Megol (golem960.delete@this.gmail.com), December 18, 2011 9:38 am
Room: Moderated Discussions
rwessel (robertwessel@yahoo.com) on 12/18/11 wrote:
---------------------------
>Megol (golem960@gmail.com) on 12/18/11 wrote:
>---------------------------
>>Ricardo B (ricardo.b@xxxxx.xx) on 12/17/11 wrote:
>>---------------------------
>>>IIRC, a x86 instruction can have 0 to 4 prefix bytes and 1 to 16 bytes total.
>>>In a straight forward approach, that's 12 x 8 x 5:1 muxes, plus the logic that
>>>decodes the prefix bytes just to get the opcodes + etc in the right place.
>>>
>>
>>No it's worse than that. 14 prefixes (most can be repeated) + 1 opcode byte is
>>a valid instruction. The limit is 15 bytes.
>
>
>While technically true, there's no need to decode instructions like that with any
>speed. Anyone coding such junk deserves what they get, performance wise. Nor would
>anyone complaining about poor performance of instructions with a bunch of repeated prefixes get *any* sympathy.
>
>And the general performance guidelines are to use as few prefixes as possible anyway.
>
Repeated prefixes can be used for code alignment and "useless" prefixes have uses too, AMD have recommended to use a prefix (REP IIRC) before RET instructions in some cases to avoid branch target aliasing.
---------------------------
>Megol (golem960@gmail.com) on 12/18/11 wrote:
>---------------------------
>>Ricardo B (ricardo.b@xxxxx.xx) on 12/17/11 wrote:
>>---------------------------
>>>IIRC, a x86 instruction can have 0 to 4 prefix bytes and 1 to 16 bytes total.
>>>In a straight forward approach, that's 12 x 8 x 5:1 muxes, plus the logic that
>>>decodes the prefix bytes just to get the opcodes + etc in the right place.
>>>
>>
>>No it's worse than that. 14 prefixes (most can be repeated) + 1 opcode byte is
>>a valid instruction. The limit is 15 bytes.
>
>
>While technically true, there's no need to decode instructions like that with any
>speed. Anyone coding such junk deserves what they get, performance wise. Nor would
>anyone complaining about poor performance of instructions with a bunch of repeated prefixes get *any* sympathy.
>
>And the general performance guidelines are to use as few prefixes as possible anyway.
>
Repeated prefixes can be used for code alignment and "useless" prefixes have uses too, AMD have recommended to use a prefix (REP IIRC) before RET instructions in some cases to avoid branch target aliasing.