aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorSanne Wouda <sanne.wouda@arm.com>2017-03-21 14:59:17 +0000
committerSanne Wouda <sanne.wouda@arm.com>2017-03-21 14:59:17 +0000
commit2409c6403d3e8013f7ace099ff8f4c650cc823b7 (patch)
treed1ec93c9ded8a03d1f9ad13738121deb4c183b28 /clang/lib/Lex/ModuleMap.cpp
parent019e1c4f9979455f1ab99cd173bf09e14c1a6004 (diff)
downloadllvm-2409c6403d3e8013f7ace099ff8f4c650cc823b7.zip
llvm-2409c6403d3e8013f7ace099ff8f4c650cc823b7.tar.gz
llvm-2409c6403d3e8013f7ace099ff8f4c650cc823b7.tar.bz2
[ARM] [Assembler] Support negative immediates for A32, T32 and T16
Summary: To support negative immediates for certain arithmetic instructions, the instruction is converted to the inverse instruction with a negated (or inverted) immediate. For example, "ADD r0, r1, #FFFFFFFF" cannot be encoded as an ADD instruction. However, "SUB r0, r1, #1" is equivalent. These conversions are different from instruction aliases. An alias maps several assembler instructions onto one encoding. A conversion, however, maps an *invalid* instruction--e.g. with an immediate that cannot be represented in the encoding--to a different (but equivalent) instruction. Several instructions with negative immediates were being converted already, but this was not systematically tested, nor did it cover all instructions. This patch implements all possible substitutions for ARM, Thumb1 and Thumb2 assembler and adds tests. It also adds a feature flag (-mattr=+no-neg-immediates) to turn these substitutions off. This is helpful for users who want their code to assemble to exactly what they wrote. Reviewers: t.p.northover, rovka, samparker, javed.absar, peter.smith, rengolin Reviewed By: javed.absar Subscribers: aadg, aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D30571 llvm-svn: 298380
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions