]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/lib/Target/MSP430/MSP430CallingConv.td
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / lib / Target / MSP430 / MSP430CallingConv.td
1 //==- 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 //===----------------------------------------------------------------------===//
15 def RetCC_MSP430 : CallingConv<[
16   // i8 are returned in registers R15B, R14B, R13B, R12B
17   CCIfType<[i8], CCAssignToReg<[R15B, R14B, R13B, R12B]>>,
18
19   // i16 are returned in registers R15, R14, R13, R12
20   CCIfType<[i16], CCAssignToReg<[R15W, R14W, R13W, R12W]>>
21 ]>;
22
23 //===----------------------------------------------------------------------===//
24 // MSP430 Argument Calling Conventions
25 //===----------------------------------------------------------------------===//
26 def CC_MSP430 : CallingConv<[
27   // Pass by value if the byval attribute is given
28   CCIfByVal<CCPassByVal<2, 2>>,
29
30   // Promote i8 arguments to i16.
31   CCIfType<[i8], CCPromoteToType<i16>>,
32
33   // The first 4 integer arguments of non-varargs functions are passed in
34   // integer registers.
35   CCIfNotVarArg<CCIfType<[i16], CCAssignToReg<[R15W, R14W, R13W, R12W]>>>,
36
37   // Integer values get stored in stack slots that are 2 bytes in
38   // size and 2-byte aligned.
39   CCIfType<[i16], CCAssignToStack<2, 2>>
40 ]>;