Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 1 | //===- HexagonCallingConv.td - Calling Conventions Hexagon -*- 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 Hexagon architectures. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | // Return Value Calling Conventions |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | // Hexagon 32-bit C return-value convention. |
| 19 | def RetCC_Hexagon32 : CallingConv<[ |
Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 20 | CCIfType<[i32, f32], CCAssignToReg<[R0, R1, R2, R3, R4, R5]>>, |
| 21 | CCIfType<[i64, f64], CCAssignToReg<[D0, D1, D2]>>, |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 22 | |
| 23 | // Alternatively, they are assigned to the stack in 4-byte aligned units. |
| 24 | CCAssignToStack<4, 4> |
| 25 | ]>; |
| 26 | |
| 27 | // Hexagon 32-bit C Calling convention. |
| 28 | def CC_Hexagon32 : CallingConv<[ |
| 29 | // All arguments get passed in integer registers if there is space. |
Sirish Pande | 7517bbc | 2012-05-10 20:20:25 +0000 | [diff] [blame] | 30 | CCIfType<[f32, i32, i16, i8], CCAssignToReg<[R0, R1, R2, R3, R4, R5]>>, |
| 31 | CCIfType<[f64, i64], CCAssignToReg<[D0, D1, D2]>>, |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 32 | |
| 33 | // Alternatively, they are assigned to the stack in 4-byte aligned units. |
| 34 | CCAssignToStack<4, 4> |
| 35 | ]>; |