@@ -5324,6 +5324,12 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
53245324 unsigned CPol = Inst.getOperand (CPolPos).getImm ();
53255325
53265326 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+ }
53275333 if (CPol & CPol::NV) {
53285334 SMLoc S = getImmLoc (AMDGPUOperand::ImmTyCPol, Operands);
53295335 StringRef CStr (S.getPointer ());
@@ -5332,6 +5338,13 @@ bool AMDGPUAsmParser::validateCoherencyBits(const MCInst &Inst,
53325338 }
53335339 }
53345340
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+
53355348 if (isGFX12Plus ())
53365349 return validateTHAndScopeBits (Inst, Operands, CPol);
53375350
@@ -7003,6 +7016,7 @@ ParseStatus AMDGPUAsmParser::parseCPol(OperandVector &Operands) {
70037016 ParseStatus ResTH = ParseStatus::NoMatch;
70047017 ParseStatus ResScope = ParseStatus::NoMatch;
70057018 ParseStatus ResNV = ParseStatus::NoMatch;
7019+ ParseStatus ResScal = ParseStatus::NoMatch;
70067020
70077021 for (;;) {
70087022 if (ResTH.isNoMatch ()) {
@@ -7041,10 +7055,22 @@ ParseStatus AMDGPUAsmParser::parseCPol(OperandVector &Operands) {
70417055 }
70427056 }
70437057
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+
70447069 break ;
70457070 }
70467071
7047- if (ResTH.isNoMatch () && ResScope.isNoMatch () && ResNV.isNoMatch ())
7072+ if (ResTH.isNoMatch () && ResScope.isNoMatch () && ResNV.isNoMatch () &&
7073+ ResScal.isNoMatch ())
70487074 return ParseStatus::NoMatch;
70497075
70507076 Operands.push_back (AMDGPUOperand::CreateImm (this , CPolVal, StringLoc,
0 commit comments