//===---- AMDCallingConv.td - Calling Conventions for Radeon GPUs ---------===// // // 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 the AMD Radeon GPUs. // //===----------------------------------------------------------------------===// // Inversion of CCIfInReg class CCIfNotInReg : CCIf<"!ArgFlags.isInReg()", A> {} // Calling convention for SI def CC_SI : CallingConv<[ CCIfInReg>>, CCIfInReg>>, CCIfNotInReg>>, CCIfByVal>> ]>; // Calling convention for compute kernels def CC_AMDGPU_Kernel : CallingConv<[ CCIfType<[v4i32, v4f32], CCAssignToStack <16, 16>>, CCIfType<[i64, f64, v2f32, v2i32], CCAssignToStack < 8, 8>>, CCIfType<[i32, f32], CCAssignToStack < 4, 4>>, CCIfType<[i16], CCAssignToStack < 2, 4>>, CCIfType<[i8], CCAssignToStack < 1, 4>> ]>; def CC_AMDGPU : CallingConv<[ CCIf<"State.getTarget().getSubtarget().getGeneration() == " "AMDGPUSubtarget::SOUTHERN_ISLANDS && " "State.getMachineFunction().getInfo()->"# "ShaderType == ShaderType::COMPUTE", CCDelegateTo>, CCIf<"State.getTarget().getSubtarget().getGeneration() < " "AMDGPUSubtarget::SOUTHERN_ISLANDS && " "State.getMachineFunction().getInfo()->" "ShaderType == ShaderType::COMPUTE", CCDelegateTo>, CCIf<"State.getTarget().getSubtarget()"# ".getGeneration() == AMDGPUSubtarget::SOUTHERN_ISLANDS", CCDelegateTo> ]>;