mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
AMDGPU: Add AMDGPU_HS calling convention
Reviewers: arsenm, nhaehnle Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D32644 llvm-svn: 301930
This commit is contained in:
parent
9b3199e036
commit
740cda5978
@ -196,6 +196,10 @@ namespace CallingConv {
|
||||
/// Register calling convention used for parameters transfer optimization
|
||||
X86_RegCall = 92,
|
||||
|
||||
/// Calling convention used for Mesa hull shaders. (= tessellation control
|
||||
/// shaders)
|
||||
AMDGPU_HS = 93,
|
||||
|
||||
/// The highest possible calling convention ID. Must be some 2^k - 1.
|
||||
MaxID = 1023
|
||||
};
|
||||
|
@ -601,6 +601,7 @@ lltok::Kind LLLexer::LexIdentifier() {
|
||||
KEYWORD(hhvm_ccc);
|
||||
KEYWORD(cxx_fast_tlscc);
|
||||
KEYWORD(amdgpu_vs);
|
||||
KEYWORD(amdgpu_hs);
|
||||
KEYWORD(amdgpu_gs);
|
||||
KEYWORD(amdgpu_ps);
|
||||
KEYWORD(amdgpu_cs);
|
||||
|
@ -1668,8 +1668,7 @@ void LLParser::ParseOptionalDLLStorageClass(unsigned &Res) {
|
||||
/// ::= 'hhvm_ccc'
|
||||
/// ::= 'cxx_fast_tlscc'
|
||||
/// ::= 'amdgpu_vs'
|
||||
/// ::= 'amdgpu_tcs'
|
||||
/// ::= 'amdgpu_tes'
|
||||
/// ::= 'amdgpu_hs'
|
||||
/// ::= 'amdgpu_gs'
|
||||
/// ::= 'amdgpu_ps'
|
||||
/// ::= 'amdgpu_cs'
|
||||
@ -1711,6 +1710,7 @@ bool LLParser::ParseOptionalCallingConv(unsigned &CC) {
|
||||
case lltok::kw_hhvm_ccc: CC = CallingConv::HHVM_C; break;
|
||||
case lltok::kw_cxx_fast_tlscc: CC = CallingConv::CXX_FAST_TLS; break;
|
||||
case lltok::kw_amdgpu_vs: CC = CallingConv::AMDGPU_VS; break;
|
||||
case lltok::kw_amdgpu_hs: CC = CallingConv::AMDGPU_HS; break;
|
||||
case lltok::kw_amdgpu_gs: CC = CallingConv::AMDGPU_GS; break;
|
||||
case lltok::kw_amdgpu_ps: CC = CallingConv::AMDGPU_PS; break;
|
||||
case lltok::kw_amdgpu_cs: CC = CallingConv::AMDGPU_CS; break;
|
||||
|
@ -153,6 +153,7 @@ enum Kind {
|
||||
kw_hhvm_ccc,
|
||||
kw_cxx_fast_tlscc,
|
||||
kw_amdgpu_vs,
|
||||
kw_amdgpu_hs,
|
||||
kw_amdgpu_gs,
|
||||
kw_amdgpu_ps,
|
||||
kw_amdgpu_cs,
|
||||
|
@ -332,6 +332,7 @@ static void PrintCallingConv(unsigned cc, raw_ostream &Out) {
|
||||
case CallingConv::HHVM: Out << "hhvmcc"; break;
|
||||
case CallingConv::HHVM_C: Out << "hhvm_ccc"; break;
|
||||
case CallingConv::AMDGPU_VS: Out << "amdgpu_vs"; break;
|
||||
case CallingConv::AMDGPU_HS: Out << "amdgpu_hs"; break;
|
||||
case CallingConv::AMDGPU_GS: Out << "amdgpu_gs"; break;
|
||||
case CallingConv::AMDGPU_PS: Out << "amdgpu_ps"; break;
|
||||
case CallingConv::AMDGPU_CS: Out << "amdgpu_cs"; break;
|
||||
|
@ -1984,6 +1984,7 @@ void Verifier::visitFunction(const Function &F) {
|
||||
"Calling convention requires void return type", &F);
|
||||
LLVM_FALLTHROUGH;
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -638,6 +638,7 @@ static unsigned getRsrcReg(CallingConv::ID CallConv) {
|
||||
switch (CallConv) {
|
||||
default: LLVM_FALLTHROUGH;
|
||||
case CallingConv::AMDGPU_CS: return R_00B848_COMPUTE_PGM_RSRC1;
|
||||
case CallingConv::AMDGPU_HS: return R_00B428_SPI_SHADER_PGM_RSRC1_HS;
|
||||
case CallingConv::AMDGPU_GS: return R_00B228_SPI_SHADER_PGM_RSRC1_GS;
|
||||
case CallingConv::AMDGPU_PS: return R_00B028_SPI_SHADER_PGM_RSRC1_PS;
|
||||
case CallingConv::AMDGPU_VS: return R_00B128_SPI_SHADER_PGM_RSRC1_VS;
|
||||
|
@ -896,6 +896,7 @@ CCAssignFn *AMDGPUTargetLowering::CCAssignFnForCall(CallingConv::ID CC,
|
||||
case CallingConv::SPIR_KERNEL:
|
||||
return CC_AMDGPU_Kernel;
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -17,6 +17,7 @@ static bool isEntryFunctionCC(CallingConv::ID CC) {
|
||||
case CallingConv::AMDGPU_KERNEL:
|
||||
case CallingConv::SPIR_KERNEL:
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -309,6 +309,7 @@ void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
|
||||
default:
|
||||
return false;
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -432,6 +432,7 @@ static bool isArgPassedInSGPR(const Argument *A) {
|
||||
case CallingConv::SPIR_KERNEL:
|
||||
return true;
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -302,6 +302,7 @@ enum DstUnused {
|
||||
#define S_00B02C_EXTRA_LDS_SIZE(x) (((x) & 0xFF) << 8)
|
||||
#define R_00B128_SPI_SHADER_PGM_RSRC1_VS 0x00B128
|
||||
#define R_00B228_SPI_SHADER_PGM_RSRC1_GS 0x00B228
|
||||
#define R_00B428_SPI_SHADER_PGM_RSRC1_HS 0x00B428
|
||||
#define R_00B848_COMPUTE_PGM_RSRC1 0x00B848
|
||||
#define S_00B028_VGPRS(x) (((x) & 0x3F) << 0)
|
||||
#define S_00B028_SGPRS(x) (((x) & 0x0F) << 6)
|
||||
|
@ -503,6 +503,7 @@ unsigned getInitialPSInputAddr(const Function &F) {
|
||||
bool isShader(CallingConv::ID cc) {
|
||||
switch(cc) {
|
||||
case CallingConv::AMDGPU_VS:
|
||||
case CallingConv::AMDGPU_HS:
|
||||
case CallingConv::AMDGPU_GS:
|
||||
case CallingConv::AMDGPU_PS:
|
||||
case CallingConv::AMDGPU_CS:
|
||||
|
@ -472,6 +472,10 @@ declare cc91 void @f.cc91()
|
||||
; CHECK: declare amdgpu_kernel void @f.cc91()
|
||||
declare amdgpu_kernel void @f.amdgpu_kernel()
|
||||
; CHECK: declare amdgpu_kernel void @f.amdgpu_kernel()
|
||||
declare cc93 void @f.cc93()
|
||||
; CHECK: declare amdgpu_hs void @f.cc93()
|
||||
declare amdgpu_hs void @f.amdgpu_hs()
|
||||
; CHECK: declare amdgpu_hs void @f.amdgpu_hs()
|
||||
declare cc1023 void @f.cc1023()
|
||||
; CHECK: declare cc1023 void @f.cc1023()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user