Re:ARM immediate value encoding (2014)
by akira2501 on Tuesday January 30, 2018 @09:56PM
(#16270967)
PowerPC has addis (add immediate shifted) though, which as it implies, shifts the immediate value 16bits to the left before the add. In this worst case, you can add any arbitrary 32bit value to any register with two opcodes.
So, is it the case that with ARM, you _may_ be able to do the same add in one op, but it's worst case appears to be 4 ops for the full range of immediate values?
Re:ARM immediate value encoding (2014)
by pcwalton on Tuesday January 30, 2018 @10:53PM
(#16271136)
For nonrepresentable constants, a compiler will usually generate a constant pool and emit a single PC-relative load instruction to materialize the value. Many assemblers have directives to do this automatically.
So, is it the case that with ARM, you _may_ be able to do the same add in one op, but it's worst case appears to be 4 ops for the full range of immediate values?