Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CISC instruction length

I was wondering, what is the maximum possible length of a CISC instruction on most of today's CISC architectures?

I haven't found the definitive answer yet, but it is suggested that it's 16 bytes long, in theory.

In the video @ around 15:00 mins, why does the speaker suggests "in theory" and why exactly 16 bytes?

like image 830
nullpotent Avatar asked Nov 30 '25 04:11

nullpotent


1 Answers

In practice as well. For the x86-64 AMD has limited the allowed instruction length to 15 bytes. After that, the instruction decoder will give up and signal an error.

Otherwise, with multiple instruction prefixes and override bytes, we don't know exactly how long the instruction could get. No limit at all, if we allow redundant repetitions of some prefixes.

Agner Fog describes the problem:

Executing three, four or five instructions simultaneously is not unusual. The limit is not the execution units, which we have plenty of, but the instruction decoder. The length of an instruction can be anywhere from one to fifteen bytes. If we want to decode several instructions simultaneously, then we have a serious problem. We have to know the length of the first instruction before we know where the second instruction begins. So we can't decode the second instruction before we have decoded the first instruction. The decoding is a serial process by nature, and it takes a lot of hardware to be able to decode multiple instructions per clock cycle. In other words, the decoding of instructions can be a serious bottleneck, and it becomes worse the more complicated the instruction codes are.

See the rest of his blog post here.

like image 50
Bo Persson Avatar answered Dec 02 '25 04:12

Bo Persson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!