1 //===- MipsCallingConv.td - Calling Conventions for Mips --------*- C++ -*-===//
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 Mips architecture.
10 //===----------------------------------------------------------------------===//
12 /// CCIfSubtarget - Match if the current subtarget has a feature F.
13 class CCIfSubtarget<string F, CCAction A>:
14 CCIf<!strconcat("State.getTarget().getSubtarget<MipsSubtarget>().", F), A>;
16 //===----------------------------------------------------------------------===//
17 // Mips Return Value Calling Convention
18 //===----------------------------------------------------------------------===//
19 def RetCC_Mips : CallingConv<[
20 // i32 are returned in registers V0, V1
21 CCIfType<[i32], CCAssignToReg<[V0, V1]>>
25 //===----------------------------------------------------------------------===//
26 // Mips Argument Calling Conventions
27 //===----------------------------------------------------------------------===//
28 def CC_Mips : CallingConv<[
29 // Promote i8/i16 arguments to i32.
30 CCIfType<[i8, i16], CCPromoteToType<i32>>,
32 // The first 4 integer arguments are passed in integer registers.
33 CCIfType<[i32], CCAssignToReg<[A0, A1, A2, A3]>>,
35 // Integer values get stored in stack slots that are 4 bytes in
36 // size and 4-byte aligned.
37 CCIfType<[i32], CCAssignToStack<4, 4>>