aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/SystemZ/SystemZCallingConv.td
blob: 8216f80a25bb25503bf0e1ee0b6e6b3e9ba3b78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//=- SystemZCallingConv.td - Calling Conventions for SystemZ -*- tablegen -*-=//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// This describes the calling conventions for SystemZ architecture.
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
// SystemZ Return Value Calling Convention
//===----------------------------------------------------------------------===//
def RetCC_SystemZ : CallingConv<[
  // i64 is returned in register R2
  CCIfType<[i64], CCAssignToReg<[R2]>>
]>;

//===----------------------------------------------------------------------===//
// SystemZ Argument Calling Conventions
//===----------------------------------------------------------------------===//
def CC_SystemZ : CallingConv<[
  // Promote i8/i16/i32 arguments to i64.
  CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,

  // The first 5 integer arguments of non-varargs functions are passed in
  // integer registers.
  // FIXME: Check stuff for varagrs
  CCIfNotVarArg<CCIfType<[i64],
                CCAssignToReg<[R2, R3, R4, R5, R6]>>>,

  // Integer values get stored in stack slots that are 8 bytes in
  // size and 8-byte aligned.
  CCIfType<[i64], CCAssignToStack<8, 8>>
]>;