blob: e5826982279a69387c7febf74e42a45f21f59a0a [file] [log] [blame]
Anton Korobeynikov9c19da02009-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<[
16 // i16 are returned in registers R15, R14, R13, R12
Anton Korobeynikovc9391402009-05-03 13:05:22 +000017 CCIfType<[i16], CCAssignToReg<[R15W, R14W, R13W, R12W]>>
Anton Korobeynikov9c19da02009-05-03 12:59:33 +000018]>;
19
20//===----------------------------------------------------------------------===//
21// MSP430 Argument Calling Conventions
22//===----------------------------------------------------------------------===//
23def CC_MSP430 : CallingConv<[
24 // Promote i8 arguments to i16.
25 CCIfType<[i8], CCPromoteToType<i16>>,
26
27 // The first 4 integer arguments of non-varargs functions are passed in
28 // integer registers.
Anton Korobeynikovc9391402009-05-03 13:05:22 +000029 CCIfNotVarArg<CCIfType<[i16], CCAssignToReg<[R15W, R14W, R13W, R12W]>>>,
Anton Korobeynikov9c19da02009-05-03 12:59:33 +000030
31 // Integer values get stored in stack slots that are 2 bytes in
32 // size and 2-byte aligned.
33 CCIfType<[i16], CCAssignToStack<2, 2>>
34]>;