1//===-- BPFCallingConv.td - Calling Conventions BPF --------*- 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//
10// This describes the calling conventions for the BPF architecture.
11//
12//===----------------------------------------------------------------------===//
13
14// BPF 64-bit C return-value convention.
15def RetCC_BPF64 : CallingConv<[CCIfType<[i64], CCAssignToReg<[R0]>>]>;
16
17// BPF 64-bit C Calling convention.
18def CC_BPF64 : CallingConv<[
19  // Promote i8/i16/i32 args to i64
20  CCIfType<[ i8, i16, i32 ], CCPromoteToType<i64>>,
21
22  // All arguments get passed in integer registers if there is space.
23  CCIfType<[i64], CCAssignToReg<[ R1, R2, R3, R4, R5 ]>>,
24
25  // Could be assigned to the stack in 8-byte aligned units, but unsupported
26  CCAssignToStack<8, 8>
27]>;
28
29def CSR : CalleeSavedRegs<(add R6, R7, R8, R9, R10)>;
30