blob: b38f5781c84a1e01ae2f6e65be798479b1a6c281 [file] [log] [blame]
Anton Korobeynikov3849be62009-05-03 12:59:33 +00001//==- MSP430CallingConv.td - Calling Conventions for MSP430 -*- 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 MSP430 architecture.
10//===----------------------------------------------------------------------===//
11
12//===----------------------------------------------------------------------===//
13// MSP430 Return Value Calling Convention
14//===----------------------------------------------------------------------===//
15def RetCC_MSP430 : CallingConv<[
Anton Korobeynikovaa51bff2009-05-03 13:11:48 +000016 // i8 are returned in registers R15B, R14B, R13B, R12B
17 CCIfType<[i8], CCAssignToReg<[R15B, R14B, R13B, R12B]>>,
18
Anton Korobeynikov3849be62009-05-03 12:59:33 +000019 // i16 are returned in registers R15, R14, R13, R12
Job Noormaneb19aea2014-09-10 06:58:14 +000020 CCIfType<[i16], CCAssignToReg<[R15, R14, R13, R12]>>
Anton Korobeynikov3849be62009-05-03 12:59:33 +000021]>;
22
23//===----------------------------------------------------------------------===//
24// MSP430 Argument Calling Conventions
25//===----------------------------------------------------------------------===//
Job Noormane9a1d4c2013-10-15 08:19:39 +000026def CC_MSP430_AssignStack : CallingConv<[
Anton Korobeynikov34148722012-11-21 17:23:03 +000027 // Pass by value if the byval attribute is given
28 CCIfByVal<CCPassByVal<2, 2>>,
29
Anton Korobeynikov3849be62009-05-03 12:59:33 +000030 // Promote i8 arguments to i16.
31 CCIfType<[i8], CCPromoteToType<i16>>,
32
Anton Korobeynikov3849be62009-05-03 12:59:33 +000033 // Integer values get stored in stack slots that are 2 bytes in
34 // size and 2-byte aligned.
35 CCIfType<[i16], CCAssignToStack<2, 2>>
36]>;
Job Noormane9a1d4c2013-10-15 08:19:39 +000037