Skip to content

Commit df2bee7

Browse files
piotrgkureksys_zuul
authored and
sys_zuul
committed
No functional change for FOSS.
The only non-obvious FOSS visible changes are: * additional dummy filed in patch token struct (SPatchExecutionEnvironment), (file patch_shared.h) * increment of const CURRENT_ICBE_VERSION, (patch_list.h) Change-Id: I38a1460995698efa551dadd7e90d46fcd7443854
1 parent 8957fd3 commit df2bee7

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

IGC/AdaptorOCL/ocl_igc_shared/executable_format/patch_list.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Abstract: Contains common patch structure definitions
3434
namespace iOpenCL
3535
{
3636

37-
const uint32_t CURRENT_ICBE_VERSION = 1059;
37+
const uint32_t CURRENT_ICBE_VERSION = 1060;
3838

3939
const uint32_t MAGIC_CL = 0x494E5443; // 'I', 'N', 'T', 'C'
4040
const uint32_t INVALID_INDEX = 0xFFFFFFFF;

IGC/AdaptorOCL/ocl_igc_shared/executable_format/patch_shared.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,11 @@ struct SPatchExecutionEnvironment :
209209
uint32_t WorkgroupWalkOrderDims; // dim0 : [0 : 1]; dim1 : [2 : 3]; dim2 : [4 : 5]
210210
uint32_t HasGlobalAtomics;
211211
uint32_t reserved;
212+
uint32_t reserved2;
212213
};
213214

214215
// Update CURRENT_ICBE_VERSION when modifying the patch list
215-
static_assert(sizeof(SPatchExecutionEnvironment) == (96 + sizeof(SPatchItemHeader)), "The size of SPatchExecutionEnvironment is not what is expected");
216+
static_assert(sizeof(SPatchExecutionEnvironment) == (100 + sizeof(SPatchItemHeader)), "The size of SPatchExecutionEnvironment is not what is expected");
216217

217218
/*****************************************************************************\
218219
STRUCT: SPatchString

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -483,37 +483,37 @@ namespace IGC
483483
assert(m_encoderState.m_flag.var == nullptr && "predicate not supported");
484484
VISA_StateOpndHandle* pSurfStateOpndHandle = GetVISASurfaceOpnd(resource);
485485
VISA_PredOpnd* predOpnd = GetFlagOperand(m_encoderState.m_flag);
486-
VISA_RawOpnd* pDst = GetRawDestination(dst);
487-
VISA_RawOpnd* pElemOffset = GetRawSource(elem_offset);
488-
VISA_RawOpnd* pSrc0 = GetRawSource(src0);
489-
VISA_RawOpnd* pSrc1 = GetRawSource(src1);
490-
491-
/*
492-
So the problem is this - the message was added for SNB, and at the time it was implemented as
493-
CMPXCHG : new = (old==src1) ? src0 : old
494-
495-
In IVB this becomes untyped atomic, and it's implemented as
496-
AOP_CMPWR (src0 == old_dst) ? src1 : old_dst old_dst
497-
498-
Note that the source is swapped. Since we define CMPXCHG as the former in vISA, internally we
499-
perform a swap for it. So I guess for now you'll need to swap the two source to follow the vISA
500-
semantics. We may want to add a new vISA message to fix this issue.
501-
*/
502-
if (atomic_op == EATOMIC_CMPXCHG) {
503-
std::swap(pSrc0, pSrc1);
504-
}
486+
VISA_RawOpnd* pDst = GetRawDestination(dst);
487+
VISA_RawOpnd* pElemOffset = GetRawSource(elem_offset);
488+
VISA_RawOpnd* pSrc0 = GetRawSource(src0);
489+
VISA_RawOpnd* pSrc1 = GetRawSource(src1);
505490

506-
V(vKernel->AppendVISASurfAccessDwordAtomicInst(
507-
predOpnd,
508-
convertAtomicOpEnumToVisa(atomic_op),
509-
is16Bit,
510-
ConvertMaskToVisaType(m_encoderState.m_mask, m_encoderState.m_noMask),
511-
visaExecSize(m_encoderState.m_simdSize),
512-
pSurfStateOpndHandle,
513-
pElemOffset,
514-
pSrc0,
515-
pSrc1,
516-
pDst));
491+
/*
492+
So the problem is this - the message was added for SNB, and at the time it was implemented as
493+
CMPXCHG : new = (old==src1) ? src0 : old
494+
495+
In IVB this becomes untyped atomic, and it's implemented as
496+
AOP_CMPWR (src0 == old_dst) ? src1 : old_dst old_dst
497+
498+
Note that the source is swapped. Since we define CMPXCHG as the former in vISA, internally we
499+
perform a swap for it. So I guess for now you'll need to swap the two source to follow the vISA
500+
semantics. We may want to add a new vISA message to fix this issue.
501+
*/
502+
if (atomic_op == EATOMIC_CMPXCHG) {
503+
std::swap(pSrc0, pSrc1);
504+
}
505+
506+
V(vKernel->AppendVISASurfAccessDwordAtomicInst(
507+
predOpnd,
508+
convertAtomicOpEnumToVisa(atomic_op),
509+
is16Bit,
510+
ConvertMaskToVisaType(m_encoderState.m_mask, m_encoderState.m_noMask),
511+
visaExecSize(m_encoderState.m_simdSize),
512+
pSurfStateOpndHandle,
513+
pElemOffset,
514+
pSrc0,
515+
pSrc1,
516+
pDst));
517517
}
518518

519519
void CEncoder::Cmp(e_predicate p, CVariable* dst, CVariable* src0, CVariable* src1)

0 commit comments

Comments
 (0)