What do 'instruction prefixes' mean in modern x86

后端 未结 2 1787
深忆病人
深忆病人 2020-12-29 07:37

To get an understanding on why Bulldozer was subpar I\'ve been looking at Agner Fog\'s excellent microarchitecture book, in it on page 178 under bulldozer it has this paragr

2条回答
  •  难免孤独
    2020-12-29 08:12

    The "four prefixes" deal comes from the "prefix groups":

    1. lock/rep/repne
    2. segment override
    3. operand size override
    4. address size override

    You can repeat prefixes, but you cannot (you can, but the behaviour is undefined) use several different prefixes from the same group. Though that only applies to groups 1 and 2, the other groups have only 1 thing in them each.

    Something like 66 66 66 66 66 66 66 66 90 is valid (but potentially slow to decode). 2E 3E 00 00 (mixing segment overrides) is not.

    Stacking prefixes can be useful for code alignment when the bytes have to be executed, unlike padding with nop it doesn't cost execution time. Using too many at once may cost decoding time.

提交回复
热议问题