Please review the attached patch. It adds support for “modified immediate” syntax form to the relevant ARM instructions. Basically these immediate fields are represented via a pair of values: one being a base value and the other a modifier. Since some of these values may have multiple representations, the ARM architecture specification defines a syntax to guarantee that a specific encoding is obtained. Supporting this syntax is a requirement for any real assembler/disassembler testing since it’s the only way to guarantee that a binary can be disassembled and reassembled into an exact copy of its former self.
LLVM-759.modimm.patch (24 KB)