[SystemZ] Add CodeGen support for integer vector types
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 5 May 2015 19:25:42 +0000 (19:25 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 5 May 2015 19:25:42 +0000 (19:25 +0000)
commitaa5c996eda6dbaab398c8502717b37de2d10e4b7
tree52cc549940184171fc44a0ade12f7b66cc7b2c2b
parent1a21909e9846aa5962b093f28c61f314ef04bb75
[SystemZ] Add CodeGen support for integer vector types

This the first of a series of patches to add CodeGen support exploiting
the instructions of the z13 vector facility.  This patch adds support
for the native integer vector types (v16i8, v8i16, v4i32, v2i64).

When the vector facility is present, we default to the new vector ABI.
This is characterized by two major differences:
- Vector types are passed/returned in vector registers
  (except for unnamed arguments of a variable-argument list function).
- Vector types are at most 8-byte aligned.

The reason for the choice of 8-byte vector alignment is that the hardware
is able to efficiently load vectors at 8-byte alignment, and the ABI only
guarantees 8-byte alignment of the stack pointer, so requiring any higher
alignment for vectors would require dynamic stack re-alignment code.

However, for compatibility with old code that may use vector types, when
*not* using the vector facility, the old alignment rules (vector types
are naturally aligned) remain in use.

These alignment rules are not only implemented at the C language level
(implemented in clang), but also at the LLVM IR level.  This is done
by selecting a different DataLayout string depending on whether the
vector ABI is in effect or not.

Based on a patch by Richard Sandiford.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236521 91177308-0d34-0410-b5e6-96231b3b80d8
95 files changed:
lib/Target/SystemZ/SystemZ.h
lib/Target/SystemZ/SystemZAsmPrinter.cpp
lib/Target/SystemZ/SystemZCallingConv.h
lib/Target/SystemZ/SystemZCallingConv.td
lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
lib/Target/SystemZ/SystemZInstrFormats.td
lib/Target/SystemZ/SystemZInstrInfo.cpp
lib/Target/SystemZ/SystemZInstrVector.td
lib/Target/SystemZ/SystemZOperators.td
lib/Target/SystemZ/SystemZTargetMachine.cpp
lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
lib/Target/SystemZ/SystemZTargetTransformInfo.h
test/CodeGen/SystemZ/frame-19.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-abi-align.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-abs-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-abs-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-abs-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-abs-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-add-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-and-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-and-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-and-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-args-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-args-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-args-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-cmp-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-cmp-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-cmp-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-cmp-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-combine-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-07.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-08.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-09.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-10.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-13.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-14.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-15.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-const-16.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-ctlz-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-ctpop-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-cttz-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-div-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-max-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-max-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-max-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-max-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-min-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-min-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-min-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-min-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-05.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-06.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-07.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-08.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-09.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-10.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-11.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-12.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-13.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-move-14.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-mul-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-mul-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-neg-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-or-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-or-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-05.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-06.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-07.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-08.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-09.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-10.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-perm-11.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-02.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-03.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-04.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-05.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-06.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-shift-07.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-sub-01.ll [new file with mode: 0644]
test/CodeGen/SystemZ/vec-xor-01.ll [new file with mode: 0644]