On 05/11/2015 03:23 PM, Andreas Krebbel wrote: > With this patch .gnu_attribute is used to mark binaries with a vector > ABI tag. This is required since the z13 vector support breaks the ABI > of existing vector_size attribute generated vector types: > > 1. vector_size(16) and bigger vectors are aligned to 8 byte > boundaries (formerly vectors were always naturally aligned) > > 2. vector_size(16) or smaller vectors are passed via VR if available > or by value on the stack (formerly vector were passed on the stack by > reference). > > The .gnu_attribute will be used by ld to emit a warning if binaries > with incompatible ABIs are being linked together: > https://sourceware.org/ml/binutils/2015-04/msg00316.html > > And it will be used by GDB to perform inferior function calls using a > vector ABI which fits to the binary being debugged: > https://sourceware.org/ml/gdb-patches/2015-04/msg00833.html > > The current implementation tries to only set the attribute if the > vector types are really used in ABI relevant contexts in order to > avoid false positives during linking. > > However, this unfortunately has some limitations like in the following > case where an ABI relevant context cannot be detected properly: > > typedef int __attribute__((vector_size(16))) v4si; > struct A > { > char x; > v4si y; > }; > char a[sizeof(struct A)]; > > The number of elements in a depends on the ABI (24 with -mvx and 32 > with -mno-vx). However, the implementation is not able to detect this > since the struct type is not used anywhere else and consequently does > not survive until the checking code is able to see it. > > Ideas about how to improve the implementation without creating too > many false postives are welcome. > > In particular we do not want to set the attribute for local uses of > vector types as they would be natural for ifunc optimizations.
Any ideas how this could be improved? That's the only patch of the IBM z13 series I did not apply yet. -Andreas-