llvm/test/MC
Sanne Wouda 94612f1d5f [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 14:59:17 +00:00
..
AArch64 [Assembler] Add location info to unary expressions. 2017-03-10 13:08:20 +00:00
AMDGPU [AMDGPU][MC] Fix for Bugs 28201, 28199, 28170 + LIT tests 2017-03-20 16:33:20 +00:00
ARM [ARM] [Assembler] Support negative immediates for A32, T32 and T16 2017-03-21 14:59:17 +00:00
AsmParser Move test input to directory called Inputs. 2017-01-06 10:22:15 +00:00
AVR
COFF MC/COFF: Do not emit forward associative section referenceds. 2017-02-17 17:32:54 +00:00
Disassembler [AMDGPU][MC] Fix for Bugs 28200, 28202 + LIT tests 2017-03-20 14:50:35 +00:00
ELF [Asm] Don't list '@<type>' in diag when '@' is a comment 2017-03-17 11:10:17 +00:00
Hexagon [Hexagon] Fixing test from 297920 to add Hexagon triple. 2017-03-16 01:52:10 +00:00
Lanai
MachO MCMacho: Allow __thread_ptr section after dwarf sections 2017-02-01 01:31:36 +00:00
Markup
Mips [Mips] Add support to match more patterns for DEXT and CINS 2017-03-15 13:10:08 +00:00
PowerPC [PowerPC][Altivec] Add mfvrd and mffprd extended mnemonic 2017-03-15 16:04:53 +00:00
Sparc
SystemZ [SystemZ] Support remaining atomic instructions 2016-12-02 18:24:16 +00:00
WebAssembly [WebAssembly] Implement the wasm binary container header. 2017-02-22 18:50:20 +00:00
X86 Check that line table entries don't spill over between sections even if they're empty at the end of a section 2017-03-16 00:52:18 +00:00