Go to file
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
clang [OpenCL] Move OpenCLBuiltins.td and remove unused include 2019-06-13 09:54:22 +00:00
clang-tools-extra [clangd] Treat lambdas as functions when preparing hover response 2019-06-13 08:51:44 +00:00
compiler-rt [compiler-rt] Fix name_to_handle_at.cc test on Overlay2 (for Docker) 2019-06-12 14:19:24 +00:00
debuginfo-tests Add cdb test for global constants 2019-06-06 20:23:05 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx Make GCC in C++03 Unsupported 2019-06-13 00:37:25 +00:00
libcxxabi [demangle] Vendor extended types shouldn't be considered substitution candidates 2019-06-10 21:02:39 +00:00
libunwind [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
lld [ELF] Loosen the condition that changes absolute relocation types to relative relocations for ARM and PPC64 2019-06-13 08:45:22 +00:00
lldb [Reproducers] Remove call to lldb_private::GetVersion() 2019-06-13 05:14:25 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [ARM] Refactor handling of IT mask operands. 2019-06-13 10:01:52 +00:00
openmp Added propagation of not big initial stack size of master thread to workers. 2019-06-05 16:14:47 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly [ScopBuilder] Move addInvariantLoads to ScopBuilder. NFC. 2019-06-12 22:51:56 +00:00
pstl [pstl] The optimized parallel versions of sort, stable_sort algorithms, TBB parallel backend. 2019-06-06 07:34:46 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitignore Add a reduced copy of the llvm .gitignore 2019-04-09 00:52:49 +00:00
README.md

README.md

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.