blob: 554c5bb0dfc3979a3cdd3cbea03ae37afd56f989 [file] [log] [blame]
Anton Korobeynikov32b7d5b2009-07-16 13:27:25 +00001//=- SystemZCallingConv.td - Calling Conventions for SystemZ -*- tablegen -*-=//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9// This describes the calling conventions for SystemZ architecture.
10//===----------------------------------------------------------------------===//
11
12//===----------------------------------------------------------------------===//
13// SystemZ Return Value Calling Convention
14//===----------------------------------------------------------------------===//
15def RetCC_SystemZ : CallingConv<[
16 // i64 is returned in register R2
Anton Korobeynikov7a123972009-07-16 13:35:30 +000017 CCIfType<[i64], CCAssignToReg<[R2D]>>
Anton Korobeynikov32b7d5b2009-07-16 13:27:25 +000018]>;
19
20//===----------------------------------------------------------------------===//
21// SystemZ Argument Calling Conventions
22//===----------------------------------------------------------------------===//
23def CC_SystemZ : CallingConv<[
24 // Promote i8/i16/i32 arguments to i64.
25 CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
26
27 // The first 5 integer arguments of non-varargs functions are passed in
28 // integer registers.
29 // FIXME: Check stuff for varagrs
30 CCIfNotVarArg<CCIfType<[i64],
Anton Korobeynikov7a123972009-07-16 13:35:30 +000031 CCAssignToReg<[R2D, R3D, R4D, R5D, R6D]>>>,
Anton Korobeynikov32b7d5b2009-07-16 13:27:25 +000032
33 // Integer values get stored in stack slots that are 8 bytes in
34 // size and 8-byte aligned.
35 CCIfType<[i64], CCAssignToStack<8, 8>>
36]>;