]> granicus.if.org Git - clang/commit
[SystemZ] Add support for z13 and its vector facility
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 5 May 2015 19:35:52 +0000 (19:35 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 5 May 2015 19:35:52 +0000 (19:35 +0000)
commita731c44cae16ad51d245ffd78958ba373cbed742
tree5a7d91f27a5aec925e299ed20a2b71aefc05c222
parentb9af15e888e1ec550683458f0317fb8270dfd229
[SystemZ] Add support for z13 and its vector facility

This patch adds support for the z13 architecture type.  For compatibility
with GCC, a pair of options -mvx / -mno-vx can be used to selectively
enable/disable use of the vector facility.

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,
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/cfe/trunk@236531 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Driver/Options.td
lib/Basic/Targets.cpp
lib/CodeGen/TargetInfo.cpp
lib/Driver/Tools.cpp
test/CodeGen/systemz-abi-vector.c
test/CodeGen/systemz-abi.c
test/CodeGen/target-data.c
test/Driver/systemz-features.cpp