@@ -12726,10 +12726,6 @@ void EmitPass::emitScalarAtomics(
12726
12726
{
12727
12727
case EATOMIC_IADD:
12728
12728
case EATOMIC_SUB:
12729
- case EATOMIC_IADD64:
12730
- case EATOMIC_SUB64:
12731
- case EATOMIC_FADD64:
12732
- case EATOMIC_FSUB64:
12733
12729
case EATOMIC_INC:
12734
12730
case EATOMIC_DEC:
12735
12731
case EATOMIC_FADD:
@@ -12775,18 +12771,13 @@ void EmitPass::emitScalarAtomics(
12775
12771
{
12776
12772
type = ISA_TYPE_F;
12777
12773
}
12778
- else if (atomic_op == EATOMIC_FADD64 || atomic_op == EATOMIC_FSUB64)
12779
- {
12780
- type = ISA_TYPE_DF;
12781
- }
12782
12774
else
12783
12775
{
12784
12776
type =
12785
12777
bitWidth == 16 ? ISA_TYPE_W :
12786
12778
bitWidth == 32 ? ISA_TYPE_D :
12787
12779
ISA_TYPE_Q;
12788
12780
}
12789
-
12790
12781
IGC_ASSERT_MESSAGE((bitWidth == 16) || (bitWidth == 32) || (bitWidth == 64), "invalid bitsize");
12791
12782
if (atomic_op == EATOMIC_INC || atomic_op == EATOMIC_DEC)
12792
12783
{
@@ -12980,7 +12971,7 @@ void EmitPass::emitScalarAtomics(
12980
12971
m_encoder->Add(pSrcsArr[i], pSrcsArr[i], pReturnVal);
12981
12972
m_encoder->Push();
12982
12973
12983
- if (atomic_op == EATOMIC_IADD || atomic_op == EATOMIC_IADD64 )
12974
+ if (atomic_op == EATOMIC_IADD)
12984
12975
{
12985
12976
m_encoder->SetSrcModifier(1, EMOD_NEG);
12986
12977
}
@@ -13110,32 +13101,14 @@ bool EmitPass::IsUniformAtomic(llvm::Instruction* pInst)
13110
13101
{
13111
13102
Function* F = pInst->getParent()->getParent();
13112
13103
//We cannot optimize float atomics if the flag "unsafe-fp-math" was not passed.
13113
- if (id == GenISAIntrinsic::GenISA_floatatomicrawA64)
13114
- {
13115
- if (!F->hasFnAttribute("unsafe-fp-math") || !(F->getFnAttribute("unsafe-fp-math").getValueAsString() == "true"))
13116
- {
13104
+ if (id == GenISAIntrinsic::GenISA_floatatomicrawA64) {
13105
+ if (pInst->getType()->getScalarSizeInBits() != 32) {
13117
13106
return false;
13118
13107
}
13119
- }
13120
-
13121
- if (pInst->getType()->getScalarSizeInBits() == 64)
13122
- {
13123
- AtomicOp atomic_op = static_cast<AtomicOp>(llvm::cast<llvm::ConstantInt>(pInst->getOperand(3))->getZExtValue());
13124
-
13125
- if ((atomic_op == EATOMIC_IADD64 || atomic_op == EATOMIC_SUB64) && m_currShader->m_Platform->hasInt64Add())
13126
- {
13127
- return true;
13128
- }
13129
- else if ((atomic_op == EATOMIC_FADD64 || atomic_op == EATOMIC_FSUB64) && m_currShader->m_Platform->hasFP64GlobalAtomicAdd())
13130
- {
13131
- return true;
13132
- }
13133
- else
13134
- {
13108
+ if (!F->hasFnAttribute("unsafe-fp-math") || !(F->getFnAttribute("unsafe-fp-math").getValueAsString() == "true")) {
13135
13109
return false;
13136
13110
}
13137
13111
}
13138
-
13139
13112
if (IGC_IS_FLAG_ENABLED(DisableScalarAtomics) ||
13140
13113
F->hasFnAttribute("KMPLOCK") ||
13141
13114
m_currShader->m_DriverInfo->WASLMPointersDwordUnit())
@@ -13152,10 +13125,6 @@ bool EmitPass::IsUniformAtomic(llvm::Instruction* pInst)
13152
13125
13153
13126
bool isAtomicAdd =
13154
13127
atomic_op == EATOMIC_IADD ||
13155
- atomic_op == EATOMIC_IADD64 ||
13156
- atomic_op == EATOMIC_SUB64 ||
13157
- atomic_op == EATOMIC_FADD64 ||
13158
- atomic_op == EATOMIC_FSUB64 ||
13159
13128
atomic_op == EATOMIC_INC ||
13160
13129
atomic_op == EATOMIC_SUB ||
13161
13130
atomic_op == EATOMIC_DEC ||
@@ -13324,7 +13293,7 @@ void EmitPass::emitAtomicRaw(llvm::GenIntrinsicInst* pInsn)
13324
13293
CVariable* pDstAddr = GetSymbol(pllDstAddr);
13325
13294
// If DisableScalarAtomics regkey is enabled or DisableIGCOptimizations regkey is enabled then
13326
13295
// don't enable scalar atomics, also do not enable for 64 bit
13327
- if (IsUniformAtomic(pInsn))
13296
+ if (IsUniformAtomic(pInsn) && bitwidth != 64 )
13328
13297
{
13329
13298
PointerType* PtrTy = dyn_cast<PointerType>(pllDstAddr->getType());
13330
13299
bool isA64 = PtrTy && isA64Ptr(PtrTy, m_currShader->GetContext());
0 commit comments