Cleanup PPC Altivec registers in CSR lists and improve VRSAVE handling
authorHal Finkel <hfinkel@anl.gov>
Tue, 2 Jul 2013 03:39:34 +0000 (03:39 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 2 Jul 2013 03:39:34 +0000 (03:39 +0000)
commit75dd57a8f0407be32551cf695e63a106dd051a27
tree9d65b27abeaed4d76994c23ea2b342910a245340
parent068acc549547bebefd40e1dffb505d1a4477572d
Cleanup PPC Altivec registers in CSR lists and improve VRSAVE handling

There are a couple of (small) related changes here:

1. The printed name of the VRSAVE register has been changed from VRsave to
vrsave in order to match the name accepted by GNU binutils.

2. Support for parsing vrsave has been added to the asm parser (it seems that
there was no test case specifically covering this code, so I've added one).

3. The list of Altivec registers, which was common to all calling conventions,
has been separated out. This allows us to define the base CSR lists, and then
lists for each ABI with Altivec included. This allows SjLj, for example, to
work correctly on non-Altivec targets without using unnatural definitions of
the NoRegs CSR list.

4. VRSAVE is now always reserved on non-Darwin targets and all Altivec
registers are reserved when Altivec is disabled.

With these changes, it is now possible to compile a function containing
__builtin_unwind_init() on Linux/PPC64 with debugging information. This did not
work previously because GNU binutils assumes that all .cfi_offset offsets will
be 8-byte aligned on PPC64 (and errors out if you provide a non-8-byte-aligned
offset). This is not true for the vrsave register, however, because this
register is used only on Darwin, GCC does not bother printing a .cfi_offset
entry for it (even though there is a slot in the stack frame for it as
specified by the ABI). This change allows us to do the same: we will also not
print .cfi_offset directives for vrsave.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185409 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
lib/Target/PowerPC/PPCCallingConv.td
lib/Target/PowerPC/PPCRegisterInfo.cpp
lib/Target/PowerPC/PPCRegisterInfo.td
test/CodeGen/PowerPC/unwind-dw2-g.ll [new file with mode: 0644]
test/MC/PowerPC/ppc64-regs.s [new file with mode: 0644]