Anton Korobeynikov | 32b7d5b | 2009-07-16 13:27:25 +0000 | [diff] [blame] | 1 | //=- SystemZCallingConv.td - Calling Conventions for SystemZ -*- 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 | // This describes the calling conventions for SystemZ architecture. |
| 10 | //===----------------------------------------------------------------------===// |
| 11 | |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | // SystemZ Return Value Calling Convention |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | def RetCC_SystemZ : CallingConv<[ |
Anton Korobeynikov | aee75f3 | 2009-07-16 13:42:31 +0000 | [diff] [blame^] | 16 | // Promote i8/i16/i32 arguments to i64. |
| 17 | CCIfType<[i8, i16, i32], CCPromoteToType<i64>>, |
| 18 | |
Anton Korobeynikov | 32b7d5b | 2009-07-16 13:27:25 +0000 | [diff] [blame] | 19 | // i64 is returned in register R2 |
Anton Korobeynikov | 7a12397 | 2009-07-16 13:35:30 +0000 | [diff] [blame] | 20 | CCIfType<[i64], CCAssignToReg<[R2D]>> |
Anton Korobeynikov | 32b7d5b | 2009-07-16 13:27:25 +0000 | [diff] [blame] | 21 | ]>; |
| 22 | |
| 23 | //===----------------------------------------------------------------------===// |
| 24 | // SystemZ Argument Calling Conventions |
| 25 | //===----------------------------------------------------------------------===// |
| 26 | def CC_SystemZ : CallingConv<[ |
| 27 | // Promote i8/i16/i32 arguments to i64. |
| 28 | CCIfType<[i8, i16, i32], CCPromoteToType<i64>>, |
| 29 | |
| 30 | // The first 5 integer arguments of non-varargs functions are passed in |
| 31 | // integer registers. |
| 32 | // FIXME: Check stuff for varagrs |
| 33 | CCIfNotVarArg<CCIfType<[i64], |
Anton Korobeynikov | 7a12397 | 2009-07-16 13:35:30 +0000 | [diff] [blame] | 34 | CCAssignToReg<[R2D, R3D, R4D, R5D, R6D]>>>, |
Anton Korobeynikov | 32b7d5b | 2009-07-16 13:27:25 +0000 | [diff] [blame] | 35 | |
| 36 | // Integer values get stored in stack slots that are 8 bytes in |
| 37 | // size and 8-byte aligned. |
| 38 | CCIfType<[i64], CCAssignToStack<8, 8>> |
| 39 | ]>; |