Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why some ARM instructions do not use barrel shifter?

Tags:

arm

I am curious about why there are some ARM instuctions (like MUL and QADD) does not use barrel shifter. I would like to know the rational behind the limit. Thanks!

like image 954
chenwj Avatar asked Sep 30 '11 03:09

chenwj


People also ask

Which of the below two instructions of ARM does not use barrel shifter?

There are data processing instructions that do not use the barrel shift, for example, the MUL (multiply), CLZ (count leading zeros), and QADD (signed saturated 32-bit add) instructions.

What is the significance of using the barrel shifter in the ARM?

A barrel shifter is a digital circuit that can shift a data word by a specified number of bits without the use of any sequential logic, only pure combinational logic, i.e. it inherently provides a binary operation.

How is a barrel shifter used with arithmetic instructions?

It is used in conjunction with a processor's arithmetic logic unit (ALU) or otherwise embedded in the ALU itself. A barrel shifter is able to shift the bits of binary data by moving it from one multiplexer to the next, with the supported number of bits dictated by how many multiplexers are used.

How barrel shifter differs from the basic shift register?

The Barrel Shifter is similar to the Shift Register (Multi-bit), except that bits shifted of the register are shifted back into the opposite end of the register. For example, in right shift operations, the LSBs shifted out of the register are shifted into the MSBs.


1 Answers

It's not that the barrel shifter isn't used; it's that you aren't able to specify how it's used in all but very specific instructions (data processing and load/store). If you look at the instruction encoding you'll see that there is just no room to specify it.

In the case of instructions like MUL or SWP, they were not in the first version of the architecture. They were squeezed into the instruction set by making use of otherwise invalid combinations of values for the specification of the barrel shifter. Since the barrel shifter specification bits had to be repurposed for storing things like what instruction to execute and what register to use as the multiplier, there was simply no way to specify how much to shift/rotate the operand.

like image 143
Gabe Avatar answered Oct 05 '22 01:10

Gabe