Add gfx11 blit/trap shaders
David Yat Sin: Rebased to amd-staging branch Changed MSG_GET_DOORBELL to MSG_RTN_GET_DOORBELL Change-Id: I6015e54c4d8897f4c796f58c7fbc298758c6d76d
This commit is contained in:
committed by
David Yat Sin
parent
9d2fe1ac2a
commit
710adcc252
@@ -212,6 +212,62 @@ static const unsigned int kCodeFill10[] = {
|
||||
0xD70F6A02, 0x0002040C, 0xD5286A03, 0x01A90103, 0xBF82FFF5, 0xBF810000,
|
||||
};
|
||||
|
||||
static const unsigned int kCodeCopyAligned11[] = {
|
||||
0xF4080100, 0xF8000000, 0xF4080200, 0xF8000010, 0xF4080300, 0xF8000020,
|
||||
0xF4080400, 0xF8000030, 0xF4080500, 0xF8000040, 0xF4000600, 0xF8000050,
|
||||
0xBF89FC0F, 0x84028602, 0xD7006A00, 0x00020002, 0x7E060205, 0xD7006A02,
|
||||
0x00000900, 0xD5206A03, 0x01A90103, 0x7E0A0207, 0xD7006A04, 0x00000D00,
|
||||
0xD5206A05, 0x01A90105, 0xD459006A, 0x00001102, 0xBFA3000F, 0x8BFE6A7E,
|
||||
0xDC400000, 0x017C0002, 0xBF8903FF, 0xD7006A02, 0x00003102, 0xD5206A03,
|
||||
0x01A90103, 0xDC600000, 0x007C0104, 0xD7006A04, 0x00003104, 0xD5206A05,
|
||||
0x01A90105, 0xBFA0FFEE, 0xBEFE01C1, 0x84198418, 0x30020084, 0x7E060209,
|
||||
0xD7006A02, 0x00001101, 0xD5206A03, 0x01A90103, 0x7E0A020B, 0xD7006A04,
|
||||
0x00001501, 0xD5206A05, 0x01A90105, 0xD459006A, 0x00001902, 0xBFA3000E,
|
||||
0xDC5C0000, 0x087C0002, 0xD7006A02, 0x00003302, 0xD5206A03, 0x01A90103,
|
||||
0xBF8903FF, 0xDC740000, 0x007C0804, 0xD7006A04, 0x00003304, 0xD5206A05,
|
||||
0x01A90105, 0xBFA0FFEF, 0x84198218, 0x30020082, 0x7E06020D, 0xD7006A02,
|
||||
0x00001901, 0xD5206A03, 0x01A90103, 0x7E0A020F, 0xD7006A04, 0x00001D01,
|
||||
0xD5206A05, 0x01A90105, 0xD459006A, 0x00002102, 0xBFA3000F, 0x8BFE6A7E,
|
||||
0xDC500000, 0x017C0002, 0xD7006A02, 0x00003302, 0xD5206A03, 0x01A90103,
|
||||
0xBF8903FF, 0xDC680000, 0x007C0104, 0xD7006A04, 0x00003304, 0xD5206A05,
|
||||
0x01A90105, 0xBFA0FFEE, 0xBEFE01C1, 0x7E060211, 0xD7006A02, 0x00002100,
|
||||
0xD5206A03, 0x01A90103, 0x7E0A0213, 0xD7006A04, 0x00002500, 0xD5206A05,
|
||||
0x01A90105, 0xD459006A, 0x00002902, 0xBFA30006, 0x8BFE6A7E, 0xDC400000,
|
||||
0x017C0002, 0xBF8903FF, 0xDC600000, 0x007C0104, 0xBFB00000,
|
||||
};
|
||||
|
||||
static const unsigned int kCodeCopyMisaligned11[] = {
|
||||
0xF4080100, 0xF8000000, 0xF4080200, 0xF8000010, 0xF4080300, 0xF8000020,
|
||||
0xF4000400, 0xF8000030, 0xBF89FC0F, 0x84028602, 0xD7006A00, 0x00020002,
|
||||
0x7E060205, 0xD7006A02, 0x00000900, 0xD5206A03, 0x01A90103, 0x7E0A0207,
|
||||
0xD7006A04, 0x00000D00, 0xD5206A05, 0x01A90105, 0xD459006A, 0x00001102,
|
||||
0xBFA30032, 0xDC400000, 0x067C0002, 0xD7006A02, 0x00002102, 0xD5206A03,
|
||||
0x01A90103, 0xDC400000, 0x077C0002, 0xD7006A02, 0x00002102, 0xD5206A03,
|
||||
0x01A90103, 0xDC400000, 0x087C0002, 0xD7006A02, 0x00002102, 0xD5206A03,
|
||||
0x01A90103, 0xDC400000, 0x097C0002, 0xD7006A02, 0x00002102, 0xD5206A03,
|
||||
0x01A90103, 0xBF8903FF, 0xDC600000, 0x007C0604, 0xD7006A04, 0x00002104,
|
||||
0xD5206A05, 0x01A90105, 0xDC600000, 0x007C0704, 0xD7006A04, 0x00002104,
|
||||
0xD5206A05, 0x01A90105, 0xDC600000, 0x007C0804, 0xD7006A04, 0x00002104,
|
||||
0xD5206A05, 0x01A90105, 0xDC600000, 0x007C0904, 0xD7006A04, 0x00002104,
|
||||
0xD5206A05, 0x01A90105, 0xBFA0FFCB, 0x7E060209, 0xD7006A02, 0x00001100,
|
||||
0xD5206A03, 0x01A90103, 0x7E0A020B, 0xD7006A04, 0x00001500, 0xD5206A05,
|
||||
0x01A90105, 0xD459006A, 0x00001902, 0xBFA3000F, 0x8BFE6A7E, 0xDC400000,
|
||||
0x017C0002, 0xD7006A02, 0x00002102, 0xD5206A03, 0x01A90103, 0xBF8903FF,
|
||||
0xDC600000, 0x007C0104, 0xD7006A04, 0x00002104, 0xD5206A05, 0x01A90105,
|
||||
0xBFA0FFEE, 0xBFB00000,
|
||||
};
|
||||
|
||||
static const unsigned int kCodeFill11[] = {
|
||||
0xF4080100, 0xF8000000, 0xF4080200, 0xF8000010, 0xBF89FC0F, 0x84028602,
|
||||
0xD7006A00, 0x00020002, 0x7E08020A, 0x7E0A020A, 0x7E0C020A, 0x7E0E020A,
|
||||
0x840C840B, 0x30020084, 0x7E060205, 0xD7006A02, 0x00000901, 0xD5206A03,
|
||||
0x01A90103, 0xD459006A, 0x00000D02, 0xBFA30007, 0xDC740000, 0x007C0402,
|
||||
0xD7006A02, 0x00001902, 0xD5206A03, 0x01A90103, 0xBFA0FFF6, 0x840C820B,
|
||||
0x30020082, 0x7E060207, 0xD7006A02, 0x00000D01, 0xD5206A03, 0x01A90103,
|
||||
0xD459006A, 0x00001102, 0xBFA30008, 0x8BFE6A7E, 0xDC680000, 0x007C0402,
|
||||
0xD7006A02, 0x00001902, 0xD5206A03, 0x01A90103, 0xBFA0FFF5, 0xBFB00000,
|
||||
};
|
||||
|
||||
} // namespace AMD
|
||||
} // namespace rocr
|
||||
|
||||
|
||||
@@ -113,6 +113,8 @@ static const unsigned int kCodeTrapHandler9[] = {
|
||||
// ttmp11 = SQ_WAVE_IB_STS[20:15], 0[18:0], NoScratch[0], WaveIdInWG[5:0]
|
||||
// gfx10:
|
||||
// ttmp11 = SQ_WAVE_IB_STS[25], SQ_WAVE_IB_STS[21:15], 0[16:0], NoScratch[0], WaveIdInWG[5:0]
|
||||
// gfx1030/gfx1100:
|
||||
// ttmp11 = 0[7:0], DebugEnabled[0], 0[15:0], NoScratch[0], WaveIdInWG[5:0]
|
||||
|
||||
.macro mGetDoorbellId
|
||||
s_mov_b32 exec_lo, 0x80000000
|
||||
|
||||
@@ -243,6 +243,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
ASICShader compute_90a;
|
||||
ASICShader compute_1010;
|
||||
ASICShader compute_10;
|
||||
ASICShader compute_11;
|
||||
};
|
||||
|
||||
std::map<std::string, CompiledShader> compiled_shaders = {
|
||||
@@ -254,6 +255,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
{kCodeTrapHandler90a, sizeof(kCodeTrapHandler90a), 2, 4},
|
||||
{kCodeTrapHandler1010, sizeof(kCodeTrapHandler1010), 2, 4},
|
||||
{kCodeTrapHandler10, sizeof(kCodeTrapHandler10), 2, 4},
|
||||
{NULL, 0, 0, 0},
|
||||
}},
|
||||
{"TrapHandlerKfdExceptions",
|
||||
{
|
||||
@@ -263,6 +265,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
{kCodeTrapHandlerV2_9, sizeof(kCodeTrapHandlerV2_9), 2, 4},
|
||||
{kCodeTrapHandlerV2_1010, sizeof(kCodeTrapHandlerV2_1010), 2, 4},
|
||||
{kCodeTrapHandlerV2_10, sizeof(kCodeTrapHandlerV2_10), 2, 4},
|
||||
{kCodeTrapHandlerV2_11, sizeof(kCodeTrapHandlerV2_11), 2, 4},
|
||||
}},
|
||||
{"CopyAligned",
|
||||
{
|
||||
@@ -272,6 +275,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
{kCodeCopyAligned8, sizeof(kCodeCopyAligned8), 32, 12},
|
||||
{kCodeCopyAligned10, sizeof(kCodeCopyAligned10), 32, 12},
|
||||
{kCodeCopyAligned10, sizeof(kCodeCopyAligned10), 32, 12},
|
||||
{kCodeCopyAligned11, sizeof(kCodeCopyAligned11), 32, 12},
|
||||
}},
|
||||
{"CopyMisaligned",
|
||||
{
|
||||
@@ -281,6 +285,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
{kCodeCopyMisaligned8, sizeof(kCodeCopyMisaligned8), 23, 10},
|
||||
{kCodeCopyMisaligned10, sizeof(kCodeCopyMisaligned10), 23, 10},
|
||||
{kCodeCopyMisaligned10, sizeof(kCodeCopyMisaligned10), 23, 10},
|
||||
{kCodeCopyMisaligned11, sizeof(kCodeCopyMisaligned11), 23, 10},
|
||||
}},
|
||||
{"Fill",
|
||||
{
|
||||
@@ -290,6 +295,7 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
{kCodeFill8, sizeof(kCodeFill8), 19, 8},
|
||||
{kCodeFill10, sizeof(kCodeFill10), 19, 8},
|
||||
{kCodeFill10, sizeof(kCodeFill10), 19, 8},
|
||||
{kCodeFill11, sizeof(kCodeFill11), 19, 8},
|
||||
}}};
|
||||
|
||||
auto compiled_shader_it = compiled_shaders.find(func_name);
|
||||
@@ -317,6 +323,9 @@ void GpuAgent::AssembleShader(const char* func_name, AssembleTarget assemble_tar
|
||||
else
|
||||
asic_shader = &compiled_shader_it->second.compute_10;
|
||||
break;
|
||||
case 11:
|
||||
asic_shader = &compiled_shader_it->second.compute_11;
|
||||
break;
|
||||
default:
|
||||
assert(false && "Precompiled shader unavailable for target");
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ cmake_minimum_required ( VERSION 3.7 )
|
||||
find_package(Clang REQUIRED HINTS ${CMAKE_PREFIX_PATH}/llvm PATHS /opt/rocm/llvm )
|
||||
find_package(LLVM REQUIRED HINTS ${CMAKE_PREFIX_PATH}/llvm PATHS /opt/rocm/llvm )
|
||||
|
||||
set (TARGET_DEVS "gfx900;gfx1010;gfx1030")
|
||||
set (POSTFIX "9;1010;10")
|
||||
set (TARGET_DEVS "gfx900;gfx1010;gfx1030;gfx1100")
|
||||
set (POSTFIX "9;1010;10;11")
|
||||
|
||||
if(${CMAKE_VERBOSE_MAKEFILE})
|
||||
get_property(clang_path TARGET clang PROPERTY LOCATION)
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
// ttmp1 = 0[0], PCRewind[5:0], HostTrap[0], TrapId[7:0], PC[47:32]
|
||||
// gfx1010:
|
||||
// ttmp11 = SQ_WAVE_IB_STS[25], SQ_WAVE_IB_STS[21:15], DebugEnabled[0], 0[15:0], NoScratch[0], WaveIdInWG[5:0]
|
||||
// gfx1030:
|
||||
// gfx1030/gfx1100:
|
||||
// ttmp11 = 0[7:0], DebugEnabled[0], 0[15:0], NoScratch[0], WaveIdInWG[5:0]
|
||||
|
||||
trap_entry:
|
||||
@@ -136,12 +136,17 @@ trap_entry:
|
||||
// Fetch doorbell id for our queue.
|
||||
s_mov_b32 ttmp2, exec_lo
|
||||
s_mov_b32 ttmp3, exec_hi
|
||||
.if .amdgcn.gfx_generation_number < 11
|
||||
s_mov_b32 exec_lo, 0x80000000
|
||||
s_sendmsg sendmsg(MSG_GET_DOORBELL)
|
||||
.wait_sendmsg:
|
||||
s_nop 0x7
|
||||
s_bitcmp0_b32 exec_lo, 0x1F
|
||||
s_cbranch_scc0 .wait_sendmsg
|
||||
.else
|
||||
s_sendmsg_rtn_b32 exec_lo, sendmsg(MSG_RTN_GET_DOORBELL)
|
||||
s_waitcnt lgkmcnt(0)
|
||||
.endif
|
||||
s_mov_b32 exec_hi, ttmp3
|
||||
|
||||
// Restore exec_lo, move the doorbell_id into ttmp3
|
||||
|
||||
Reference in New Issue
Block a user