1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib
Sanne Wouda 472490f306 [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
2017-03-21 14:59:17 +00:00
..
Analysis [ConstantFolding] Fix to prevent constant folding having to repeatedly scan operands. NFCI 2017-03-21 10:17:39 +00:00
AsmParser [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
Bitcode SamplePGO ThinLTO ICP fix for local functions. 2017-03-14 17:33:01 +00:00
CodeGen [GlobalISel] Move isTriviallyDead to Utils. NFC. 2017-03-21 10:47:35 +00:00
DebugInfo Revert "Make NativeExeSymbol a concrete subclass of NativeRawSymbol [PDB]" 2017-03-17 00:46:42 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine Use MutableArrayRef for APFloat::convertToInteger 2017-03-20 14:40:12 +00:00
Fuzzer [libFuzzer] inline the code of __sanitizer_cov_trace_pc_guard into it 2017-03-17 01:45:15 +00:00
IR Updates branch_weights annotation for call instructions during inlining. 2017-03-20 16:40:44 +00:00
IRReader Timer: Track name and description. 2016-11-18 19:43:18 +00:00
LibDriver LibDriver: Allow resource files to be archive members. 2016-12-15 19:37:46 +00:00
LineEditor
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Try using llvm::errc, should hopefully fix version mismatch problem on clang-s390x-linux bot. 2017-03-20 18:19:41 +00:00
MC [Asm] Don't list '@<type>' in diag when '@' is a comment 2017-03-17 11:10:17 +00:00
Object Add the rest of the error checking for Mach-O dyld compact bind entry errors 2017-03-20 19:46:55 +00:00
ObjectYAML [ObjectYAML] Fix issue with DWARF2 AddrSize 8 2017-03-07 21:34:35 +00:00
Option Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Passes Add call branch annotation for ICP promoted direct call in SamplePGO mode. 2017-02-23 22:15:18 +00:00
ProfileData SamplePGO ThinLTO ICP fix for local functions. 2017-03-14 17:33:01 +00:00
Support [Support] Fill the file_status struct with link count. 2017-03-20 23:55:20 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target [ARM] [Assembler] Support negative immediates for A32, T32 and T16 2017-03-21 14:59:17 +00:00
Transforms Test commit access 2017-03-21 14:49:19 +00:00
XRay [XRAY] [x86_64] Adding a Flight Data filetype reader to the llvm-xray Trace implementation. 2017-02-17 01:47:16 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt