]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/lib/Target/CellSPU/SPUCallingConv.td
MFC r234353:
[FreeBSD/stable/9.git] / contrib / llvm / lib / Target / CellSPU / SPUCallingConv.td
1 //===- SPUCallingConv.td - Calling Conventions for CellSPU -*- 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 STI Cell SPU architecture.
11 //
12 //===----------------------------------------------------------------------===//
13
14 //===----------------------------------------------------------------------===//
15 // Return Value Calling Convention
16 //===----------------------------------------------------------------------===//
17
18 // Return-value convention for Cell SPU: return value to be passed in reg 3-74
19 def RetCC_SPU : CallingConv<[
20   CCIfType<[i8,i16,i32,i64,i128,f32,f64,v16i8,v8i16,v4i32,v2i64,v4f32,v2f64],
21   CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
22                  R12, R13, R14, R15, R16, R17, R18, R19, R20,
23                  R21, R22, R23, R24, R25, R26, R27, R28, R29,
24                  R30, R31, R32, R33, R34, R35, R36, R37, R38,
25                  R39, R40, R41, R42, R43, R44, R45, R46, R47,
26                  R48, R49, R50, R51, R52, R53, R54, R55, R56,
27                  R57, R58, R59, R60, R61, R62, R63, R64, R65,
28                  R66, R67, R68, R69, R70, R71, R72, R73, R74]>>
29 ]>;
30
31
32 //===----------------------------------------------------------------------===//
33 // CellSPU Argument Calling Conventions
34 //===----------------------------------------------------------------------===//
35 def CCC_SPU : CallingConv<[
36   CCIfType<[i8, i16, i32, i64, i128, f32, f64, 
37             v16i8, v8i16, v4i32, v4f32, v2i64, v2f64],
38             CCAssignToReg<[R3,   R4,  R5,  R6,  R7,  R8,  R9, R10, R11,
39                            R12, R13, R14, R15, R16, R17, R18, R19, R20,
40                            R21, R22, R23, R24, R25, R26, R27, R28, R29,
41                            R30, R31, R32, R33, R34, R35, R36, R37, R38,
42                            R39, R40, R41, R42, R43, R44, R45, R46, R47,
43                            R48, R49, R50, R51, R52, R53, R54, R55, R56,
44                            R57, R58, R59, R60, R61, R62, R63, R64, R65,
45                            R66, R67, R68, R69, R70, R71, R72, R73, R74]>>,
46   // Integer/FP values get stored in stack slots that are 8 bytes in size and
47   // 8-byte aligned if there are no more registers to hold them.
48   CCIfType<[i32, i64, f32, f64], CCAssignToStack<8, 8>>,
49   
50   // Vectors get 16-byte stack slots that are 16-byte aligned.
51   CCIfType<[v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
52               CCAssignToStack<16, 16>>
53 ]>;