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//===----------------------------------------------------------------------===// 15def RetCC_SystemZ : CallingConv<[ 16 // Promote i8/i16/i32 arguments to i64. 17 CCIfType<[i8, i16, i32], CCPromoteToType<i64>>, 18 19 // i64 is returned in register R2 20 CCIfType<[i64], CCAssignToReg<[R2D, R3D, R4D, R5D]>>, 21 22 // f32 / f64 are returned in F0 23 CCIfType<[f32], CCAssignToReg<[F0S, F2S, F4S, F6S]>>, 24 CCIfType<[f64], CCAssignToReg<[F0L, F2L, F4L, F6L]>> 25]>; 26 27//===----------------------------------------------------------------------===// 28// SystemZ Argument Calling Conventions 29//===----------------------------------------------------------------------===// 30def CC_SystemZ : CallingConv<[ 31 // Promote i8/i16/i32 arguments to i64. 32 CCIfType<[i8, i16, i32], CCPromoteToType<i64>>, 33 34 // The first 5 integer arguments of non-varargs functions are passed in 35 // integer registers. 36 CCIfType<[i64], CCAssignToReg<[R2D, R3D, R4D, R5D, R6D]>>, 37 38 // The first 4 floating point arguments of non-varargs functions are passed 39 // in FP registers. 40 CCIfType<[f32], CCAssignToReg<[F0S, F2S, F4S, F6S]>>, 41 CCIfType<[f64], CCAssignToReg<[F0L, F2L, F4L, F6L]>>, 42 43 // Integer values get stored in stack slots that are 8 bytes in 44 // size and 8-byte aligned. 45 CCIfType<[i64, f32, f64], CCAssignToStack<8, 8>> 46]>; 47