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]>>
20 //===----------------------------------------------------------------------===//
21 // XCore Argument Calling Conventions
22 //===----------------------------------------------------------------------===//
23 def CC_XCore : CallingConv<[
24 // Promote i8/i16 arguments to i32.
25 CCIfType<[i8, i16], CCPromoteToType<i32>>,
27 // The 'nest' parameter, if any, is passed in R11.
28 CCIfNest<CCAssignToReg<[R11]>>,
30 // The first 4 integer arguments are passed in integer registers.
31 CCIfType<[i32], CCAssignToReg<[R0, R1, R2, R3]>>,
33 // Integer values get stored in stack slots that are 4 bytes in
34 // size and 4-byte aligned.
35 CCIfType<[i32], CCAssignToStack<4, 4>>