2009-07-16 15:27:25 +02:00
|
|
|
//=- SystemZCallingConv.td - Calling Conventions for SystemZ -*- tablegen -*-=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// This describes the calling conventions for SystemZ architecture.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// SystemZ Return Value Calling Convention
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def RetCC_SystemZ : CallingConv<[
|
2009-07-16 15:42:31 +02:00
|
|
|
// Promote i8/i16/i32 arguments to i64.
|
|
|
|
CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
|
|
|
|
|
2009-07-16 15:27:25 +02:00
|
|
|
// i64 is returned in register R2
|
2009-07-18 14:51:06 +02:00
|
|
|
CCIfType<[i64], CCAssignToReg<[R2D, R3D, R4D, R5D]>>,
|
2009-07-16 16:19:16 +02:00
|
|
|
|
|
|
|
// f32 / f64 are returned in F0
|
2009-07-18 14:51:06 +02:00
|
|
|
CCIfType<[f32], CCAssignToReg<[F0S, F2S, F4S, F6S]>>,
|
|
|
|
CCIfType<[f64], CCAssignToReg<[F0L, F2L, F4L, F6L]>>
|
2009-07-16 15:27:25 +02:00
|
|
|
]>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// SystemZ Argument Calling Conventions
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
def CC_SystemZ : CallingConv<[
|
|
|
|
// Promote i8/i16/i32 arguments to i64.
|
|
|
|
CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
|
|
|
|
|
|
|
|
// The first 5 integer arguments of non-varargs functions are passed in
|
|
|
|
// integer registers.
|
2009-07-16 16:11:03 +02:00
|
|
|
CCIfType<[i64], CCAssignToReg<[R2D, R3D, R4D, R5D, R6D]>>,
|
2009-07-16 15:27:25 +02:00
|
|
|
|
2009-07-16 16:24:57 +02:00
|
|
|
// The first 4 floating point arguments of non-varargs functions are passed
|
2009-07-16 16:19:16 +02:00
|
|
|
// in FP registers.
|
|
|
|
CCIfType<[f32], CCAssignToReg<[F0S, F2S, F4S, F6S]>>,
|
|
|
|
CCIfType<[f64], CCAssignToReg<[F0L, F2L, F4L, F6L]>>,
|
|
|
|
|
2009-07-16 15:27:25 +02:00
|
|
|
// Integer values get stored in stack slots that are 8 bytes in
|
|
|
|
// size and 8-byte aligned.
|
2009-07-16 16:24:57 +02:00
|
|
|
CCIfType<[i64, f32, f64], CCAssignToStack<8, 8>>
|
2009-07-16 15:27:25 +02:00
|
|
|
]>;
|