1 //===- XCoreCallingConv.td - Calling Conventions for XCore -*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 // This describes the calling conventions for XCore architecture.
10 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
13 // XCore Return Value Calling Convention
14 //===----------------------------------------------------------------------===//
15 def RetCC_XCore : CallingConv<[
16 // i32 are returned in registers R0, R1, R2, R3
17 CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>,
19 // Integer values get stored in stack slots that are 4 bytes in
20 // size and 4-byte aligned.
21 CCIfType<[i32], CCAssignToStack<4, 4>>
24 //===----------------------------------------------------------------------===//
25 // XCore Argument Calling Conventions
26 //===----------------------------------------------------------------------===//
27 def CC_XCore : CallingConv<[
28 // Promote i8/i16 arguments to i32.
29 CCIfType<[i8, i16], CCPromoteToType<i32>>,
31 // The 'nest' parameter, if any, is passed in R11.
32 CCIfNest<CCAssignToReg<[R11]>>,
34 // The first 4 integer arguments are passed in integer registers.
35 CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>,
37 // Integer values get stored in stack slots that are 4 bytes in
38 // size and 4-byte aligned.
39 CCIfType<[i32], CCAssignToStack<4, 4>>