4 ms·
The Thumb encoding for ARM also has some very clever encodings for inline constants: https://developer.arm.com/documentation/ddi0308/d/Thumb-Instructions/Immed
by duskwuff 3y ago
The Thumb encoding for ARM also has some very clever encodings for inline constants:
https://developer.arm.com/documentation/ddi0308/d/Thumb-Instructions/Immediate-constants/Encoding https://developer.arm.com/documentation/ddi0308/d/Thumb-Inst...
Specifically, it can encode any 8-bit value rotated by any number of bits, as well as any value of the form 0x00XY00XY, 0xXY00XY00, or 0xXYXYXYXY. Combined with the use of inverted instructions (e.g. MVN instead of MOV, SUB instead of AND, BIC instead of AND, etc), this covers a surprising number of the 32-bit constants which are likely to appear in a program.