@@ -5324,6 +5324,12 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
5324
5324
unsigned CPol = Inst.getOperand (CPolPos).getImm ();
5325
5325
5326
5326
if (!isGFX1250 ()) {
5327
+ if (CPol & CPol::SCAL) {
5328
+ SMLoc S = getImmLoc (AMDGPUOperand::ImmTyCPol, Operands);
5329
+ StringRef CStr (S.getPointer ());
5330
+ S = SMLoc::getFromPointer (&CStr.data ()[CStr.find (" scale_offset" )]);
5331
+ Error (S, " scale_offset is not supported on this GPU" );
5332
+ }
5327
5333
if (CPol & CPol::NV) {
5328
5334
SMLoc S = getImmLoc (AMDGPUOperand::ImmTyCPol, Operands);
5329
5335
StringRef CStr (S.getPointer ());
@@ -5332,6 +5338,13 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
5332
5338
}
5333
5339
}
5334
5340
5341
+ if ((CPol & CPol::SCAL) && !supportsScaleOffset (MII, Inst.getOpcode ())) {
5342
+ SMLoc S = getImmLoc (AMDGPUOperand::ImmTyCPol, Operands);
5343
+ StringRef CStr (S.getPointer ());
5344
+ S = SMLoc::getFromPointer (&CStr.data ()[CStr.find (" scale_offset" )]);
5345
+ Error (S, " scale_offset is not supported for this instruction" );
5346
+ }
5347
+
5335
5348
if (isGFX12Plus ())
5336
5349
return validateTHAndScopeBits (Inst, Operands, CPol);
5337
5350
@@ -7003,6 +7016,7 @@ ParseStatus AMDGPUAsmParser::parseCPol(OperandVector &Operands) {
7003
7016
ParseStatus ResTH = ParseStatus::NoMatch;
7004
7017
ParseStatus ResScope = ParseStatus::NoMatch;
7005
7018
ParseStatus ResNV = ParseStatus::NoMatch;
7019
+ ParseStatus ResScal = ParseStatus::NoMatch;
7006
7020
7007
7021
for (;;) {
7008
7022
if (ResTH.isNoMatch ()) {
@@ -7041,10 +7055,22 @@ ParseStatus AMDGPUAsmParser::parseCPol(OperandVector &Operands) {
7041
7055
}
7042
7056
}
7043
7057
7058
+ if (ResScal.isNoMatch ()) {
7059
+ if (trySkipId (" scale_offset" )) {
7060
+ ResScal = ParseStatus::Success;
7061
+ CPolVal |= CPol::SCAL;
7062
+ continue ;
7063
+ } else if (trySkipId (" no" , " scale_offset" )) {
7064
+ ResScal = ParseStatus::Success;
7065
+ continue ;
7066
+ }
7067
+ }
7068
+
7044
7069
break ;
7045
7070
}
7046
7071
7047
- if (ResTH.isNoMatch () && ResScope.isNoMatch () && ResNV.isNoMatch ())
7072
+ if (ResTH.isNoMatch () && ResScope.isNoMatch () && ResNV.isNoMatch () &&
7073
+ ResScal.isNoMatch ())
7048
7074
return ParseStatus::NoMatch;
7049
7075
7050
7076
Operands.push_back (AMDGPUOperand::CreateImm (this , CPolVal, StringLoc,
0 commit comments