llvm-mirror/test
Simon Tatham 6709634733 [ARM,MVE] Fix vreinterpretq in big-endian mode.
Summary:
In big-endian MVE, the simple vector load/store instructions (i.e.
both contiguous and non-widening) don't all store the bytes of a
register to memory in the same order: it matters whether you did a
VSTRB.8, VSTRH.16 or VSTRW.32. Put another way, the in-register
formats of different vector types relate to each other in a different
way from the in-memory formats.

So, if you want to 'bitcast' or 'reinterpret' one vector type as
another, you have to carefully specify which you mean: did you want to
reinterpret the //register// format of one type as that of the other,
or the //memory// format?

The ACLE `vreinterpretq` intrinsics are specified to reinterpret the
register format. But I had implemented them as LLVM IR bitcast, which
is specified for all types as a reinterpretation of the memory format.
So a `vreinterpretq` intrinsic, applied to values already in registers,
would code-generate incorrectly if compiled big-endian: instead of
emitting no code, it would emit a `vrev`.

To fix this, I've introduced a new IR intrinsic to perform a
register-format reinterpretation: `@llvm.arm.mve.vreinterpretq`. It's
implemented by a trivial isel pattern that expects the input in an
MQPR register, and just returns it unchanged.

In the clang codegen, I only emit this new intrinsic where it's
actually needed: I prefer a bitcast wherever it will have the right
effect, because LLVM understands bitcasts better. So we still generate
bitcasts in little-endian mode, and even in big-endian when you're
casting between two vector types with the same lane size.

For testing, I've moved all the codegen tests of vreinterpretq out
into their own file, so that they can have a different set of RUN
lines to check both big- and little-endian.

Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73786
2020-02-03 11:20:06 +00:00
..
Analysis [ConstantFold][SVE][NFC] Add test for select instruction in scalable vector. 2020-01-30 10:56:12 -08:00
Assembler Add a test extracted from D69557 "AsmParser: Allow FMF on varargs call" 2020-01-29 16:46:45 +00:00
Bindings
Bitcode [SVE] Pass Scalable argument to VectorType::get in Bitcode Reader 2020-01-22 12:29:25 -08:00
BugPoint
CodeGen [ARM,MVE] Fix vreinterpretq in big-endian mode. 2020-02-03 11:20:06 +00:00
DebugInfo [CodeGenPrepare] Make TargetPassConfig required 2020-02-02 09:28:45 -08:00
Demangle
Examples
ExecutionEngine [ORC] Add support for emulated TLS to ORCv2. 2020-01-21 19:55:33 -08:00
Feature Activate extension loading test on Darwin now that the underlying fix has landed 2020-01-30 14:04:27 +01:00
FileCheck FileCheck [9/12]: Add support for matching formats 2020-01-24 14:15:28 +00:00
Instrumentation [Instrumentation] Set hidden visibility for the bias variable 2020-01-28 12:07:03 -08:00
Integer
JitListener
Linker
LTO [LTO] Add optimization remarks for removed functions 2020-01-29 15:53:51 -08:00
MachineVerifier
MC [RISCV] Implement jump pseudo-instruction 2020-01-31 22:28:26 +00:00
Object [llvm-readobj][test] - Cleanup testing of the --sections command line option. 2020-01-31 12:58:12 +03:00
ObjectYAML [DWARF] Return Error from DWARFDebugArangeSet::extract(). 2020-01-23 12:41:05 +07:00
Other [test] More tests to target specific directories after CodeGenPrepare requires TargetPassConfig (D73754) 2020-02-02 10:43:02 -08:00
Reduce
SafepointIRVerifier
Support
SymbolRewriter
TableGen TableGen/GlobalISel: Handle non-leaf EXTRACT_SUBREG 2020-01-24 12:15:10 -08:00
ThinLTO/X86 [ThinLTO] Disable "Always import constants" due to compile time issues 2020-01-30 10:12:48 -08:00
tools Make quick-append.test resilient to running in paths with '1.o' in the name 2020-02-03 11:35:24 +01:00
Transforms [JumpThreading] Half the duplicate threshold at Oz 2020-02-03 08:40:20 +00:00
Unit
Verifier Implement -fsemantic-interposition 2020-01-31 14:02:33 +01:00
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg.py
lit.site.cfg.py.in
TestRunner.sh