Why do some ARM instructions not use a barrel switch?

I'm curious why there are some ARM installations (like MUL and QADD) that don't use barrel shift. I would like to know the rational beyond. Thank you

+6
source share
2 answers

Not that the barrel is not used; this is that you cannot specify how it is used in all but very specific instructions (data processing and loading / storage). If you look at the encoding of the commands, you will see that there is simply no place to indicate it.

In the case of commands such as MUL or SWP , they were not in the first version of the architecture. They were compressed in the instruction set, using otherwise invalid value combinations for the barrel switch specification. Since the bits of the barrel specification had to be redesigned to store things such as what the command should execute and which register to use as the multiplier, there simply was no way to indicate how much to shift / rotate the operand.

+11
source

For quick switching, a barrel switch is used.

As you know, if you multiply a number with another number that has a power of two, you just need to shift it to the left. In such special situations, you can use the shift register. But overall, its multiplications are effective to follow normal multiplier designs.

-3
source

Source: https://habr.com/ru/post/898339/


All Articles