Skip to content

Commit 853be23

Browse files
matborzyszkowskiigcbot
authored andcommitted
Add BMG support
Add BMG support
1 parent 27bf604 commit 853be23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+323
-71
lines changed

IGC/AdaptorCommon/RayTracing/RTBuilder.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ std::pair<uint32_t, uint32_t> RTBuilder::getSliceIDBitsInSR0() const {
11521152
{
11531153
return {12, 14};
11541154
}
1155-
else if (Ctx.platform.GetPlatformFamily() == IGFX_XE2_LPG_CORE)
1155+
else if (Ctx.platform.GetPlatformFamily() == IGFX_XE2_HPG_CORE)
11561156
{
11571157
return {11, 15};
11581158
}
@@ -1168,7 +1168,7 @@ std::pair<uint32_t, uint32_t> RTBuilder::getSubsliceIDBitsInSR0() const {
11681168
{
11691169
return {12, 13};
11701170
}
1171-
else if (Ctx.platform.GetPlatformFamily() == IGFX_XE2_LPG_CORE)
1171+
else if (Ctx.platform.GetPlatformFamily() == IGFX_XE2_HPG_CORE)
11721172
{
11731173
return {8, 9};
11741174
}
@@ -1541,7 +1541,8 @@ Value* RTBuilder::getSyncStackID()
15411541
{
15421542
return _getSyncStackID_Xe_HPC(VALUE_NAME("SyncStackID"));
15431543
}
1544-
else if (PlatformInfo.eProductFamily == IGFX_LUNARLAKE)
1544+
else if (PlatformInfo.eProductFamily == IGFX_BMG ||
1545+
PlatformInfo.eProductFamily == IGFX_LUNARLAKE)
15451546
{
15461547
return _getSyncStackID_Xe2(VALUE_NAME("SyncStackID"));
15471548
}

IGC/AdaptorCommon/RayTracing/RTBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class RTBuilder : public IGCIRBuilder<>
7373
enabledSlices++;
7474
}
7575
}
76-
isChildOfXe2 = Ctx.platform.isCoreChildOf(IGFX_XE2_LPG_CORE);
76+
isChildOfXe2 = Ctx.platform.isCoreChildOf(IGFX_XE2_HPG_CORE);
7777

7878
if (isChildOfXe2 || Ctx.platform.isProductChildOf(IGFX_PVC))
7979
{

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ SPDX-License-Identifier: MIT
2929
#include <string>
3030
#include <fstream>
3131
#include "Probe/Assertion.h"
32+
#include "messageEncoding.hpp"
3233

3334
#if !defined(_WIN32)
3435
# define _strdup strdup
@@ -2220,6 +2221,9 @@ namespace IGC
22202221

22212222
void CEncoder::Send(CVariable* dst, CVariable* src, uint exDesc, CVariable* messDescriptor, bool isSendc)
22222223
{
2224+
IGC_ASSERT_MESSAGE(m_program->m_Platform->getPlatformInfo().eProductFamily < IGFX_BMG ||
2225+
(exDesc & 0xF) == EU_MESSAGE_TARGET_SFID_BTD || (exDesc & 0xF) == EU_MESSAGE_TARGET_SFID_RTA || (exDesc & 0xF) == EU_GEN7_MESSAGE_TARGET_PIXEL_INTERPOLATOR,
2226+
"raw send is not allowed on bmg+ platforms");
22232227
if (dst && dst->IsUniform())
22242228
{
22252229
m_encoderState.m_simdSize = m_encoderState.m_uniformSIMDSize;
@@ -2252,6 +2256,9 @@ namespace IGC
22522256

22532257
void CEncoder::Sends(CVariable* dst, CVariable* src0, CVariable* src1, uint ffid, CVariable* exDesc, CVariable* messDescriptor, bool isSendc, bool hasEOT)
22542258
{
2259+
IGC_ASSERT_MESSAGE(m_program->m_Platform->getPlatformInfo().eProductFamily < IGFX_BMG ||
2260+
ffid == EU_MESSAGE_TARGET_SFID_BTD || ffid == EU_MESSAGE_TARGET_SFID_RTA || ffid == EU_GEN7_MESSAGE_TARGET_PIXEL_INTERPOLATOR,
2261+
"raw sends is not allowed on bmg+ platforms");
22552262
if (exDesc->IsImmediate() && src1 == nullptr)
22562263
{
22572264
Send(dst, src0, (uint)exDesc->GetImmediateValue(), messDescriptor, isSendc);
@@ -3199,7 +3206,7 @@ namespace IGC
31993206
return Xe_PVC; // PVC XL A0 RevID=0x0
32003207
}
32013208
}
3202-
case IGFX_XE2_LPG_CORE:
3209+
case IGFX_XE2_HPG_CORE:
32033210
return Xe2;
32043211
// fall-through
32053212
default:

IGC/Compiler/CISACodeGen/CShader.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,17 @@ void CShader::EOTURBWrite()
212212
// If return value is not a nullptr, the returned variable is a send message
213213
// writeback variable that must be read in order to wait for URB Fence
214214
// completion, e.g. the variable may be used as payload to EOTGateway.
215-
CVariable* CShader::URBFence()
215+
CVariable* CShader::URBFence(LSC_SCOPE scope)
216216
{
217+
if (m_Platform->hasLSCUrbMessage())
218+
{
219+
encoder.LSC_Fence(LSC_URB, scope, LSC_FENCE_OP_EVICT);
220+
encoder.Push();
221+
// Return nullptr as LSC URB message has no writeback register
222+
// to read.
223+
return nullptr;
224+
}
225+
else
217226
{
218227
// A legacy HDC URB fence message issued by a thread causes further
219228
// messages issued by the thread to be blocked until all previous URB
@@ -941,7 +950,8 @@ CVariable* CShader::GetHWTID()
941950
{
942951
if (m_Platform->getHWTIDFromSR0())
943952
{
944-
if (m_Platform->getPlatformInfo().eProductFamily == IGFX_LUNARLAKE)
953+
if ((m_Platform->getPlatformInfo().eProductFamily == IGFX_BMG) ||
954+
(m_Platform->getPlatformInfo().eProductFamily == IGFX_LUNARLAKE))
945955
{
946956
if (m_DriverInfo->supportsLogicalSSIDInHWTID())
947957
{
@@ -1476,6 +1486,14 @@ uint CShader::GetNbVectorElementAndMask(llvm::Value* val, uint32_t& mask)
14761486
maxIndex = nbElement;
14771487
break;
14781488
}
1489+
// Non-transposed LSC load messages support only 1, 2, 3, 4 and
1490+
// 8 element vectors. Transposed loads also support 16, 32 and 64.
1491+
if (m_Platform->hasLSCUrbMessage() &&
1492+
(IID == GenISAIntrinsic::GenISA_URBRead ||
1493+
IID == GenISAIntrinsic::GenISA_URBReadOutput))
1494+
{
1495+
maxIndex = maxIndex > 4 ? iSTD::RoundPower2((DWORD)maxIndex) : maxIndex;
1496+
}
14791497

14801498
mask = BIT(maxIndex) - 1;
14811499
nbElement = maxIndex;
@@ -3362,7 +3380,7 @@ CVariable* CShader::GetSymbol(llvm::Value* value, bool fromConstantPool,
33623380
{
33633381
mult = 2;
33643382
}
3365-
if (m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE) && value->getType()->isIntegerTy(16) && m_SIMDSize == SIMDMode::SIMD16)
3383+
if (m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE) && value->getType()->isIntegerTy(16) && m_SIMDSize == SIMDMode::SIMD16)
33663384
{
33673385
IGC_ASSERT(m_Platform->getGRFSize() == 64);
33683386
mult = 2;

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6735,7 +6735,7 @@ void EmitPass::emitMediaBlockIO(const llvm::GenIntrinsicInst* inst, bool isRead)
67356735
}
67366736

67376737
auto surfaceType = isBindless ? ESURFACE_BINDLESS : ESURFACE_NORMAL;
6738-
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
6738+
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
67396739
{
67406740
m_encoder->LSC_Typed2dBlock(LSC_STORE_BLOCK2D, pDst, surfaceType, pImg, pXOffset, pYOffset, (int)widthInBytes, (int)blockHeight);
67416741
}
@@ -6792,7 +6792,7 @@ void EmitPass::emitMediaBlockRectangleRead(llvm::Instruction* inst)
67926792
IGC_ASSERT(blockWidth * blockHeight == pDst->GetSize());
67936793

67946794
auto surfaceType = isBindless ? ESURFACE_BINDLESS : ESURFACE_NORMAL;
6795-
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
6795+
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
67966796
{
67976797
m_encoder->LSC_Typed2dBlock(LSC_LOAD_BLOCK2D, pDst, surfaceType, src, xOffset, yOffset, (int)blockWidth, (int)blockHeight);
67986798
}
@@ -7030,7 +7030,7 @@ void EmitPass::emitSimdMediaBlockRead(llvm::Instruction* inst)
70307030
CVariable* dstVar = numPasses_axisX == 1 ? m_destination : pTempDest;
70317031

70327032
auto surfaceType = isBindless ? ESURFACE_BINDLESS : ESURFACE_NORMAL;
7033-
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
7033+
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
70347034
{
70357035
m_encoder->LSC_Typed2dBlock(
70367036
LSC_LOAD_BLOCK2D,
@@ -7414,7 +7414,7 @@ void EmitPass::emitSimdMediaBlockWrite(llvm::Instruction* inst)
74147414
blockHeight;
74157415

74167416
auto surfaceType = isBindless ? ESURFACE_BINDLESS : ESURFACE_NORMAL;
7417-
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
7417+
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
74187418
{
74197419
m_encoder->LSC_Typed2dBlock(
74207420
LSC_STORE_BLOCK2D,
@@ -8705,7 +8705,7 @@ void EmitPass::EmitGenIntrinsicMessage(llvm::GenIntrinsicInst* inst)
87058705
emitStateRegID(11, 13);
87068706
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE_HPC_CORE)
87078707
emitStateRegID(12, 14);
8708-
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_LPG_CORE)
8708+
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_HPG_CORE)
87098709
emitStateRegID(11, 15);
87108710
else
87118711
emitStateRegID(12, 14);
@@ -8720,7 +8720,7 @@ void EmitPass::EmitGenIntrinsicMessage(llvm::GenIntrinsicInst* inst)
87208720
IGFX_XE_HPC_CORE) {
87218721
emitStateRegID(9, 11);
87228722
}
8723-
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_LPG_CORE)
8723+
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_HPG_CORE)
87248724
emitStateRegID(8, 9);
87258725
else
87268726
emitStateRegID(8, 8);
@@ -8770,7 +8770,7 @@ void EmitPass::EmitGenIntrinsicMessage(llvm::GenIntrinsicInst* inst)
87708770
IGFX_XE_HPC_CORE) {
87718771
emitStateRegID(4, 5);
87728772
}
8773-
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_LPG_CORE)
8773+
else if (m_currShader->m_Platform->GetPlatformFamily() == IGFX_XE2_HPG_CORE)
87748774
emitStateRegID(4, 6);
87758775
else
87768776
emitStateRegID(4, 7);
@@ -15910,7 +15910,7 @@ void EmitPass::emitFlushSamplerCache()
1591015910

1591115911
void EmitPass::emitUniformAtomicCounter(llvm::GenIntrinsicInst* pInsn)
1591215912
{
15913-
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
15913+
if (m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
1591415914
{
1591515915
return emitLscUniformAtomicCounter(pInsn);
1591615916
}
@@ -21823,7 +21823,7 @@ EmitPass::cacheOptionsForConstantBufferLoads(Instruction* inst) const
2182321823
{
2182421824
Optional<LSC_CACHE_OPTS> cacheOpts;
2182521825
if (IGC_IS_FLAG_DISABLED(DisableSystemMemoryCachingInGPUForConstantBuffers) &&
21826-
m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_LPG_CORE))
21826+
m_currShader->m_Platform->isCoreChildOf(IGFX_XE2_HPG_CORE))
2182721827
{
2182821828
if (auto Opts = cacheOptionsForConstantBufferLoads(inst, LSC_L1C_L3CC))
2182921829
cacheOpts = *Opts;

0 commit comments

Comments
 (0)