AnyCPU
http://anycpu.org/forum/

A calculator for ARM's literals, and an explanation
http://anycpu.org/forum/viewtopic.php?f=3&t=321
Page 1 of 1

Author:  BigEd [ Thu Sep 29, 2016 1:22 pm ]
Post subject:  A calculator for ARM's literals, and an explanation

.
I had a use for this calculator the other day:
https://alisdair.mcdiarmid.org/arm-imme ... -encoding/

Image

ARM contains a barrel shifter, which means many instructions can do an arbitrary shift as well as whatever else they are doing. This was part of the philosophy of making maximum use of memory bandwidth: each instruction can do a little more work, saving instruction fetch bandwidth, and indeed the machine does as much work as it can within the available cycle time of memory (at that time.)

In RISC-like instruction sets, there's a difficulty in that operands would like to be the full width of the instruction word, but there must be a little room for the opcode too. The difficulty applies to program addresses in branches, jumps and calls, and also applies to literals. ARM''s solution for literals is to use a mantissa-plus-exponent format, whereby the shifter is used to place a bit pattern anywhere in the word. You can't always get the arbitrary 32 bit constants you might want, but you can often get what you need.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/