llvm-project/llvm
Simon Tatham 848d3d0d2c [ARM] Refactor handling of IT mask operands.
During assembly, the mask operand to an IT instruction (storing the
sequence of T/E for 'Then' and 'Else') is parsed out of the mnemonic
into a representation that encodes 'Then' and 'Else' in the same way
regardless of the condition code. At some point during encoding it has
to be converted into the instruction encoding used in the
architecture, in which the mask encodes a sequence of replacement
low-order bits for the condition code, so that which bit value means
'then' and which 'else' depends on whether the original condition code
had its low bit set.

Previously, that transformation was done by processInstruction(), half
way through assembly. So an MCOperand storing an IT mask would
sometimes store it in one format, and sometimes in the other,
depending on where in the assembly pipeline you were. You can see this
in diagnostics from `llvm-mc -debug -triple=thumbv8a -show-inst`, for
example: if you give it an instruction such as `itete eq`, you'd see
an `<MCOperand Imm:5>` in a diagnostic become `<MCOperand Imm:11>` in
the final output.

Having the same data structure store values with time-dependent
semantics is confusing already, and it will get more confusing when we
introduce the MVE VPT instruction which reuses the Then/Else bitmask
idea in a different context. So I'm refactoring: now, all `ARMOperand`
and `MCOperand` representations of an IT mask work exactly the same
way, namely, 0 means 'Then' and 1 means 'Else', regardless of what
original predicate is being referred to. The architectural encoding of
IT that depends on the original condition is now constructed at the
point when we turn the `MCOperand` into the final instruction bit
pattern, and decoded similarly in the disassembler.

The previous condition-independent parse-time format used 0 for Else
and 1 for Then. I've taken the opportunity to flip the sense of it
while I'm changing all of this anyway, because it seems to me more
natural to use 0 for 'leave the starting condition unchanged' and 1
for 'invert it', as if those bits were an XOR mask.

Reviewers: ostannard

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D63219

llvm-svn: 363244
2019-06-13 10:01:52 +00:00
..
benchmarks
bindings [bindings/go][NFC] Format code with go fmt 2019-06-12 11:59:09 +00:00
cmake Build with _XOPEN_SOURCE defined on AIX 2019-06-07 15:45:25 +00:00
docs Improve reduction intrinsics by overloading result value. 2019-06-13 09:37:38 +00:00
examples Add a HowToUseLLJIT example project. 2019-05-22 21:38:41 +00:00
include Improve reduction intrinsics by overloading result value. 2019-06-13 09:37:38 +00:00
lib [ARM] Refactor handling of IT mask operands. 2019-06-13 10:01:52 +00:00
projects
resources
runtimes Setup testing target dependencies for default runtimes 2019-06-11 00:25:57 +00:00
test [llvm-objcopy] Implement IHEX reader 2019-06-13 09:56:14 +00:00
tools [llvm-objcopy] Implement IHEX reader 2019-06-13 09:56:14 +00:00
unittests [Analysis] add isSplatValue() for vectors in IR 2019-06-11 22:25:18 +00:00
utils Improve reduction intrinsics by overloading result value. 2019-06-13 09:37:38 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore gitignore: Ignore Qt Creator project configuration files. NFC 2019-06-12 08:28:31 +00:00
CMakeLists.txt Build with _XOPEN_SOURCE defined on AIX 2019-06-07 15:45:25 +00:00
CODE_OWNERS.TXT
CREDITS.TXT [test commit] Add my name to the CREDITS.TXT 2019-05-27 07:48:28 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.