use of Barrel shifter IN ARM TDMI 9

i am preparing for intervew and i want the answer how Barrel shifter can be used to optimize of C code at ARM processor.

i have learnt that Barrel shifter is :A digital circuit that can shift a data word by any number of bits in a single cycle. It is implemented as a sequence of multiplexors: the output of one MUX is connected to the input of the next MUX in a way that depends on the shift distance. The number of multiplexors required is log2(n), where n is the computer's register size.

Reply to
Loading thread data ...


In the interview, say exactly this:

"It's how the compiler uses its ARMs. See, the barrel shape is perfect for hiding the application's private data. So the ARMs hold up the barrel. Shifting is done up or down as needed to improve performance."

The position will be yours for the taking.

NOTE: This is a joke. Don't do this in real life.


David Ashley      
Embedded linux, device drivers, system architecture
Reply to
David Ashley

There are many uses: The most basic application could be merging of multiple data bit fields into one word. For example, we need to put value A in upper half word of a register and value B is lower half word, and if we know that both values are less then 16 bits and unsigned, we can write

C = (A

Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.