llvm.org GIT mirror llvm / 23cd383
[AMDGPU][MC] Enabled expressions for most operands which accept integer values See bug 40873: https://bugs.llvm.org/show_bug.cgi?id=40873 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D60768 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361031 91177308-0d34-0410-b5e6-96231b3b80d8 Dmitry Preobrazhensky 6 months ago
11 changed file(s) with 545 addition(s) and 232 deletion(s). Raw diff Collapse all Expand all
461461 }
462462
463463 bool isVSrcB32() const {
464 return isVCSrcF32() || isLiteralImm(MVT::i32);
464 return isVCSrcF32() || isLiteralImm(MVT::i32) || isExpr();
465465 }
466466
467467 bool isVSrcB64() const {
477477 }
478478
479479 bool isVSrcF32() const {
480 return isVCSrcF32() || isLiteralImm(MVT::f32);
480 return isVCSrcF32() || isLiteralImm(MVT::f32) || isExpr();
481481 }
482482
483483 bool isVSrcF64() const {
10961096 OperandMatchResultTy parseStringWithPrefix(StringRef Prefix,
10971097 StringRef &Value);
10981098
1099 bool parseAbsoluteExpr(int64_t &Val, bool HasSP3AbsModifier = false);
1099 bool isModifier();
1100 bool isOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const;
1101 bool isRegOrOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const;
1102 bool isNamedOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const;
1103 bool isOpcodeModifierWithVal(const AsmToken &Token, const AsmToken &NextToken) const;
11001104 bool parseSP3NegModifier();
11011105 OperandMatchResultTy parseImm(OperandVector &Operands, bool HasSP3AbsModifier = false);
11021106 OperandMatchResultTy parseReg(OperandVector &Operands);
20382042 return AMDGPUOperand::CreateReg(this, Reg, StartLoc, EndLoc);
20392043 }
20402044
2041 bool
2042 AMDGPUAsmParser::parseAbsoluteExpr(int64_t &Val, bool HasSP3AbsModifier) {
2043 if (HasSP3AbsModifier) {
2044 // This is a workaround for handling expressions
2045 // as arguments of SP3 'abs' modifier, for example:
2046 // |1.0|
2047 // |-1|
2048 // |1+x|
2049 // This syntax is not compatible with syntax of standard
2050 // MC expressions (due to the trailing '|').
2051
2052 SMLoc EndLoc;
2053 const MCExpr *Expr;
2054 SMLoc StartLoc = getLoc();
2055
2056 if (getParser().parsePrimaryExpr(Expr, EndLoc)) {
2057 return true;
2058 }
2059
2060 if (!Expr->evaluateAsAbsolute(Val))
2061 return Error(StartLoc, "expected absolute expression");
2062
2063 return false;
2064 }
2065
2066 return getParser().parseAbsoluteExpression(Val);
2067 }
2068
20692045 OperandMatchResultTy
20702046 AMDGPUAsmParser::parseImm(OperandVector &Operands, bool HasSP3AbsModifier) {
20712047 // TODO: add syntactic sugar for 1/(2*PI)
20722048
2049 assert(!isRegister());
2050 assert(!isModifier());
2051
20732052 const auto& Tok = getToken();
20742053 const auto& NextTok = peekToken();
20752054 bool IsReal = Tok.is(AsmToken::Real);
2076 SMLoc S = Tok.getLoc();
2055 SMLoc S = getLoc();
20772056 bool Negate = false;
20782057
20792058 if (!IsReal && Tok.is(AsmToken::Minus) && NextTok.is(AsmToken::Real)) {
21042083
21052084 return MatchOperand_Success;
21062085
2107 // FIXME: Should enable arbitrary expressions here
2108 } else if (Tok.is(AsmToken::Integer) ||
2109 (Tok.is(AsmToken::Minus) && NextTok.is(AsmToken::Integer))){
2110
2086 } else {
21112087 int64_t IntVal;
2112 if (parseAbsoluteExpr(IntVal, HasSP3AbsModifier))
2113 return MatchOperand_ParseFail;
2114
2115 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
2088 const MCExpr *Expr;
2089 SMLoc S = getLoc();
2090
2091 if (HasSP3AbsModifier) {
2092 // This is a workaround for handling expressions
2093 // as arguments of SP3 'abs' modifier, for example:
2094 // |1.0|
2095 // |-1|
2096 // |1+x|
2097 // This syntax is not compatible with syntax of standard
2098 // MC expressions (due to the trailing '|').
2099 SMLoc EndLoc;
2100 if (getParser().parsePrimaryExpr(Expr, EndLoc))
2101 return MatchOperand_ParseFail;
2102 } else {
2103 if (Parser.parseExpression(Expr))
2104 return MatchOperand_ParseFail;
2105 }
2106
2107 if (Expr->evaluateAsAbsolute(IntVal)) {
2108 Operands.push_back(AMDGPUOperand::CreateImm(this, IntVal, S));
2109 } else {
2110 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
2111 }
2112
21162113 return MatchOperand_Success;
21172114 }
21182115
21352132 OperandMatchResultTy
21362133 AMDGPUAsmParser::parseRegOrImm(OperandVector &Operands, bool HasSP3AbsMod) {
21372134 auto res = parseReg(Operands);
2138 return (res == MatchOperand_NoMatch)?
2139 parseImm(Operands, HasSP3AbsMod) :
2140 res;
2135 if (res != MatchOperand_NoMatch) {
2136 return res;
2137 } else if (isModifier()) {
2138 return MatchOperand_NoMatch;
2139 } else {
2140 return parseImm(Operands, HasSP3AbsMod);
2141 }
2142 }
2143
2144 bool
2145 AMDGPUAsmParser::isNamedOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const {
2146 if (Token.is(AsmToken::Identifier) && NextToken.is(AsmToken::LParen)) {
2147 const auto &str = Token.getString();
2148 return str == "abs" || str == "neg" || str == "sext";
2149 }
2150 return false;
2151 }
2152
2153 bool
2154 AMDGPUAsmParser::isOpcodeModifierWithVal(const AsmToken &Token, const AsmToken &NextToken) const {
2155 return Token.is(AsmToken::Identifier) && NextToken.is(AsmToken::Colon);
2156 }
2157
2158 bool
2159 AMDGPUAsmParser::isOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const {
2160 return isNamedOperandModifier(Token, NextToken) || Token.is(AsmToken::Pipe);
2161 }
2162
2163 bool
2164 AMDGPUAsmParser::isRegOrOperandModifier(const AsmToken &Token, const AsmToken &NextToken) const {
2165 return isRegister(Token, NextToken) || isOperandModifier(Token, NextToken);
2166 }
2167
2168 // Check if this is an operand modifier or an opcode modifier
2169 // which may look like an expression but it is not. We should
2170 // avoid parsing these modifiers as expressions. Currently
2171 // recognized sequences are:
2172 // |...|
2173 // abs(...)
2174 // neg(...)
2175 // sext(...)
2176 // -reg
2177 // -|...|
2178 // -abs(...)
2179 // name:...
2180 // Note that simple opcode modifiers like 'gds' may be parsed as
2181 // expressions; this is a special case. See getExpressionAsToken.
2182 //
2183 bool
2184 AMDGPUAsmParser::isModifier() {
2185
2186 AsmToken Tok = getToken();
2187 AsmToken NextToken[2];
2188 peekTokens(NextToken);
2189
2190 return isOperandModifier(Tok, NextToken[0]) ||
2191 (Tok.is(AsmToken::Minus) && isRegOrOperandModifier(NextToken[0], NextToken[1])) ||
2192 isOpcodeModifierWithVal(Tok, NextToken[0]);
21412193 }
21422194
21432195 // Check if the current token is an SP3 'neg' modifier.
22372289
22382290 if (Mods.hasFPModifiers()) {
22392291 AMDGPUOperand &Op = static_cast(*Operands.back());
2292 if (Op.isExpr()) {
2293 Error(Op.getStartLoc(), "expected an absolute expression");
2294 return MatchOperand_ParseFail;
2295 }
22402296 Op.setModifiers(Mods);
22412297 }
22422298 return MatchOperand_Success;
22672323
22682324 if (Mods.hasIntModifiers()) {
22692325 AMDGPUOperand &Op = static_cast(*Operands.back());
2326 if (Op.isExpr()) {
2327 Error(Op.getStartLoc(), "expected an absolute expression");
2328 return MatchOperand_ParseFail;
2329 }
22702330 Op.setModifiers(Mods);
22712331 }
22722332
39093969 return MatchOperand_Success;
39103970 }
39113971
3912 ResTy = parseRegOrImm(Operands);
3913
3914 if (ResTy == MatchOperand_Success || ResTy == MatchOperand_ParseFail)
3915 return ResTy;
3916
3917 const auto &Tok = Parser.getTok();
3918 SMLoc S = Tok.getLoc();
3919
3920 const MCExpr *Expr = nullptr;
3921 if (!Parser.parseExpression(Expr)) {
3922 Operands.push_back(AMDGPUOperand::CreateExpr(this, Expr, S));
3923 return MatchOperand_Success;
3924 }
3925
3926 // Possibly this is an instruction flag like 'gds'.
3927 if (Tok.getKind() == AsmToken::Identifier) {
3928 Operands.push_back(AMDGPUOperand::CreateToken(this, Tok.getString(), S));
3929 Parser.Lex();
3930 return MatchOperand_Success;
3931 }
3932
3933 return MatchOperand_NoMatch;
3972 return parseRegOrImm(Operands);
39343973 }
39353974
39363975 StringRef AMDGPUAsmParser::parseMnemonicSuffix(StringRef Name) {
438438 Kind = FK_PCRel_4;
439439 else
440440 Kind = FK_Data_4;
441 Fixups.push_back(MCFixup::create(4, MO.getExpr(), Kind, MI.getLoc()));
441
442 const MCInstrDesc &Desc = MCII.get(MI.getOpcode());
443 uint32_t Offset = Desc.getSize();
444 assert(Offset == 4 || Offset == 8);
445
446 Fixups.push_back(
447 MCFixup::create(Offset, MO.getExpr(), Kind, MI.getLoc()));
442448 }
443449
444450 // Figure out the operand number, needed for isSrcOperand check
5454 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,0]
5555 // GFX906: error: failed parsing operand
5656 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[-1,-1]
57 // GFX906: error: not a valid operand
57 // GFX906: error: failed parsing operand
5858 v_dot2_f32_f16 v0, v1, v2, v3 op_sel:[0,0,0,0,0]
5959 // GFX906: error: failed parsing operand
6060 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi
8282 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,0]
8383 // GFX906: error: failed parsing operand
8484 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[-1,-1]
85 // GFX906: error: not a valid operand
85 // GFX906: error: failed parsing operand
8686 v_dot2_f32_f16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0]
8787 // GFX906: error: failed parsing operand
8888 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo
110110 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,0]
111111 // GFX906: error: failed parsing operand
112112 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[-1,-1]
113 // GFX906: error: not a valid operand
113 // GFX906: error: failed parsing operand
114114 v_dot2_f32_f16 v0, v1, v2, v3 neg_lo:[0,0,0,0,0]
115115 // GFX906: error: failed parsing operand
116116 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi
138138 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,0]
139139 // GFX906: error: failed parsing operand
140140 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[-1,-1]
141 // GFX906: error: not a valid operand
141 // GFX906: error: failed parsing operand
142142 v_dot2_f32_f16 v0, v1, v2, v3 neg_hi:[0,0,0,0,0]
143143 // GFX906: error: failed parsing operand
144144 v_dot2_i32_i16 v0, v1, v2, v3 op_sel
166166 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,0]
167167 // GFX906: error: failed parsing operand
168168 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[-1,-1]
169 // GFX906: error: not a valid operand
169 // GFX906: error: failed parsing operand
170170 v_dot2_i32_i16 v0, v1, v2, v3 op_sel:[0,0,0,0,0]
171171 // GFX906: error: failed parsing operand
172172 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi
194194 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,0]
195195 // GFX906: error: failed parsing operand
196196 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[-1,-1]
197 // GFX906: error: not a valid operand
197 // GFX906: error: failed parsing operand
198198 v_dot2_i32_i16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0]
199199 // FIXME-GFX906: error: invalid operand for instruction
200200 v_dot2_i32_i16 v0, v1, v2, v3 neg_lo:[0,0]
226226 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,0]
227227 // GFX906: error: failed parsing operand
228228 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[-1,-1]
229 // GFX906: error: not a valid operand
229 // GFX906: error: failed parsing operand
230230 v_dot2_u32_u16 v0, v1, v2, v3 op_sel:[0,0,0,0,0]
231231 // GFX906: error: failed parsing operand
232232 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi
254254 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,0]
255255 // GFX906: error: failed parsing operand
256256 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[-1,-1]
257 // GFX906: error: not a valid operand
257 // GFX906: error: failed parsing operand
258258 v_dot2_u32_u16 v0, v1, v2, v3 op_sel_hi:[0,0,0,0,0]
259259 // FIXME-GFX906: error: invalid operand for instruction
260260 v_dot2_u32_u16 v0, v1, v2, v3 neg_lo:[0,0]
277277 v_dot2_f32_f16 v0, |v1|, v2, |v3|
278278 // GFX906: error: not a valid operand
279279 v_dot2_f32_f16 v0, |v1|, |v2|, |v3|
280 // GFX906: error: invalid operand for instruction
280 // GFX906: error: not a valid operand
281281 v_dot2_f32_f16 v0, abs(v1), v2, v3
282 // GFX906: error: invalid operand for instruction
282 // GFX906: error: not a valid operand
283283 v_dot2_f32_f16 v0, v1, abs(v2), v3
284 // GFX906: error: invalid operand for instruction
284 // GFX906: error: not a valid operand
285285 v_dot2_f32_f16 v0, v1, v2, abs(v3)
286 // GFX906: error: invalid operand for instruction
286 // GFX906: error: not a valid operand
287287 v_dot2_f32_f16 v0, abs(v1), abs(v2), v3
288 // GFX906: error: invalid operand for instruction
288 // GFX906: error: not a valid operand
289289 v_dot2_f32_f16 v0, abs(v1), v2, abs(v3)
290 // GFX906: error: invalid operand for instruction
290 // GFX906: error: not a valid operand
291291 v_dot2_f32_f16 v0, abs(v1), abs(v2), abs(v3)
292 // GFX906: error: invalid operand for instruction
292 // GFX906: error: not a valid operand
293293 v_dot2_f32_f16 v0, -v1, v2, v3
294 // GFX906: error: invalid operand for instruction
294 // GFX906: error: not a valid operand
295295 v_dot2_f32_f16 v0, v1, -v2, v3
296 // GFX906: error: invalid operand for instruction
296 // GFX906: error: not a valid operand
297297 v_dot2_f32_f16 v0, v1, v2, -v3
298 // GFX906: error: invalid operand for instruction
298 // GFX906: error: not a valid operand
299299 v_dot2_f32_f16 v0, -v1, -v2, v3
300 // GFX906: error: invalid operand for instruction
300 // GFX906: error: not a valid operand
301301 v_dot2_f32_f16 v0, -v1, v2, -v3
302 // GFX906: error: invalid operand for instruction
302 // GFX906: error: not a valid operand
303303 v_dot2_f32_f16 v0, -v1, -v2, -v3
304304 // GFX906: error: not a valid operand
305305 v_dot2_i32_i16 v0, |v1|, v2, v3
313313 v_dot2_i32_i16 v0, |v1|, v2, |v3|
314314 // GFX906: error: not a valid operand
315315 v_dot2_i32_i16 v0, |v1|, |v2|, |v3|
316 // GFX906: error: invalid operand for instruction
316 // GFX906: error: not a valid operand
317317 v_dot2_i32_i16 v0, abs(v1), v2, v3
318 // GFX906: error: invalid operand for instruction
318 // GFX906: error: not a valid operand
319319 v_dot2_i32_i16 v0, v1, abs(v2), v3
320 // GFX906: error: invalid operand for instruction
320 // GFX906: error: not a valid operand
321321 v_dot2_i32_i16 v0, v1, v2, abs(v3)
322 // GFX906: error: invalid operand for instruction
322 // GFX906: error: not a valid operand
323323 v_dot2_i32_i16 v0, abs(v1), abs(v2), v3
324 // GFX906: error: invalid operand for instruction
324 // GFX906: error: not a valid operand
325325 v_dot2_i32_i16 v0, abs(v1), v2, abs(v3)
326 // GFX906: error: invalid operand for instruction
326 // GFX906: error: not a valid operand
327327 v_dot2_i32_i16 v0, abs(v1), abs(v2), abs(v3)
328 // GFX906: error: invalid operand for instruction
328 // GFX906: error: not a valid operand
329329 v_dot2_i32_i16 v0, -v1, v2, v3
330 // GFX906: error: invalid operand for instruction
330 // GFX906: error: not a valid operand
331331 v_dot2_i32_i16 v0, v1, -v2, v3
332 // GFX906: error: invalid operand for instruction
332 // GFX906: error: not a valid operand
333333 v_dot2_i32_i16 v0, v1, v2, -v3
334 // GFX906: error: invalid operand for instruction
334 // GFX906: error: not a valid operand
335335 v_dot2_i32_i16 v0, -v1, -v2, v3
336 // GFX906: error: invalid operand for instruction
336 // GFX906: error: not a valid operand
337337 v_dot2_i32_i16 v0, -v1, v2, -v3
338 // GFX906: error: invalid operand for instruction
338 // GFX906: error: not a valid operand
339339 v_dot2_i32_i16 v0, -v1, -v2, -v3
340340 // GFX906: error: not a valid operand
341341 v_dot2_u32_u16 v0, |v1|, v2, v3
349349 v_dot2_u32_u16 v0, |v1|, v2, |v3|
350350 // GFX906: error: not a valid operand
351351 v_dot2_u32_u16 v0, |v1|, |v2|, |v3|
352 // GFX906: error: invalid operand for instruction
352 // GFX906: error: not a valid operand
353353 v_dot2_u32_u16 v0, abs(v1), v2, v3
354 // GFX906: error: invalid operand for instruction
354 // GFX906: error: not a valid operand
355355 v_dot2_u32_u16 v0, v1, abs(v2), v3
356 // GFX906: error: invalid operand for instruction
356 // GFX906: error: not a valid operand
357357 v_dot2_u32_u16 v0, v1, v2, abs(v3)
358 // GFX906: error: invalid operand for instruction
358 // GFX906: error: not a valid operand
359359 v_dot2_u32_u16 v0, abs(v1), abs(v2), v3
360 // GFX906: error: invalid operand for instruction
360 // GFX906: error: not a valid operand
361361 v_dot2_u32_u16 v0, abs(v1), v2, abs(v3)
362 // GFX906: error: invalid operand for instruction
362 // GFX906: error: not a valid operand
363363 v_dot2_u32_u16 v0, abs(v1), abs(v2), abs(v3)
364 // GFX906: error: invalid operand for instruction
364 // GFX906: error: not a valid operand
365365 v_dot2_u32_u16 v0, -v1, v2, v3
366 // GFX906: error: invalid operand for instruction
366 // GFX906: error: not a valid operand
367367 v_dot2_u32_u16 v0, v1, -v2, v3
368 // GFX906: error: invalid operand for instruction
368 // GFX906: error: not a valid operand
369369 v_dot2_u32_u16 v0, v1, v2, -v3
370 // GFX906: error: invalid operand for instruction
370 // GFX906: error: not a valid operand
371371 v_dot2_u32_u16 v0, -v1, -v2, v3
372 // GFX906: error: invalid operand for instruction
372 // GFX906: error: not a valid operand
373373 v_dot2_u32_u16 v0, -v1, v2, -v3
374 // GFX906: error: invalid operand for instruction
374 // GFX906: error: not a valid operand
375375 v_dot2_u32_u16 v0, -v1, -v2, -v3
376376
377377 //
0 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1010 -show-encoding %s | FileCheck %s --check-prefix=GFX10
1
2 i1=1
3
4 //===----------------------------------------------------------------------===//
5 // Constant expressions may be used where literals are accepted.
6 //===----------------------------------------------------------------------===//
7
8 v_bfe_u32 v0, i1+100, v1, v2
9 // GFX10: v_bfe_u32 v0, 0x65, v1, v2 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x0a,0x04,0x65,0x00,0x00,0x00]
10
11 v_bfe_u32 v0, v1, i1-100, v2
12 // GFX10: v_bfe_u32 v0, v1, 0xffffff9d, v2 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0x09,0x04,0x9d,0xff,0xff,0xff]
13
14 v_bfe_u32 v0, v1, v2, (i1+100)*2
15 // GFX10: v_bfe_u32 v0, v1, v2, 0xca ; encoding: [0x00,0x00,0x48,0xd5,0x01,0x05,0xfe,0x03,0xca,0x00,0x00,0x00]
16
17 v_cmp_f_i32 s[10:11], (i1+100)*2, v2
18 // GFX10: v_cmp_f_i32_e64 s[10:11], 0xca, v2 ; encoding: [0x0a,0x00,0x80,0xd4,0xff,0x04,0x02,0x00,0xca,0x00,0x00,0x00]
19
20 v_cmpx_f_i64 v[1:2], i1+100
21 // GFX10: v_cmpx_f_i64_e64 v[1:2], 0x65 ; encoding: [0x00,0x00,0xb0,0xd4,0x01,0xff,0x01,0x00,0x65,0x00,0x00,0x00]
22
23 v_lshlrev_b64 v[5:6], i1+0xFFE, v[2:3]
24 // GFX10: v_lshlrev_b64 v[5:6], 0xfff, v[2:3] ; encoding: [0x05,0x00,0xff,0xd6,0xff,0x04,0x02,0x00,0xff,0x0f,0x00,0x00]
25
26 //===----------------------------------------------------------------------===//
27 // Relocatable expressions can be used with 32-bit instructions.
28 //===----------------------------------------------------------------------===//
29
30 v_bfe_u32 v0, u, v1, v2
31 // GFX10: v_bfe_u32 v0, u, v1, v2 ; encoding: [0x00,0x00,0x48,0xd5,0xff,0x02,0x0a,0x04,A,A,A,A]
32 // GFX10-NEXT: ; fixup A - offset: 8, value: u, kind: FK_PCRel_4
33
34 v_bfe_u32 v0, v1, u-1, v2
35 // GFX10: v_bfe_u32 v0, v1, u-1, v2 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0xff,0x09,0x04,A,A,A,A]
36 // GFX10-NEXT: ; fixup A - offset: 8, value: u-1, kind: FK_Data_4
37
38 v_bfe_u32 v0, v1, v2, u+1
39 // GFX10: v_bfe_u32 v0, v1, v2, u+1 ; encoding: [0x00,0x00,0x48,0xd5,0x01,0x05,0xfe,0x03,A,A,A,A]
40 // GFX10-NEXT: ; fixup A - offset: 8, value: u+1, kind: FK_PCRel_4
41
42 v_cmp_f_i32 s[10:11], u+1, v2
43 // GFX10: v_cmp_f_i32_e64 s[10:11], u+1, v2 ; encoding: [0x0a,0x00,0x80,0xd4,0xff,0x04,0x02,0x00,A,A,A,A]
44 // GFX10-NEXT: ; fixup A - offset: 8, value: u+1, kind: FK_PCRel_4
45
46 v_lshlrev_b64 v[5:6], u-1, v[2:3]
47 // GFX10: v_lshlrev_b64 v[5:6], u-1, v[2:3] ; encoding: [0x05,0x00,0xff,0xd6,0xff,0x04,0x02,0x00,A,A,A,A]
48 // GFX10-NEXT: ; fixup A - offset: 8, value: u-1, kind: FK_Data_4
0 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck %s --check-prefix=VI
11 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOVI
22
3 //===----------------------------------------------------------------------===//
4 // Floating-point expressions are not supported
5 //===----------------------------------------------------------------------===//
6
7 s_sub_u32 s0, s0, -1.0 + 10000000000
8 // NOVI: error: invalid operand for instruction
9
10 t=10000000000
11 s_sub_u32 s0, s0, 1.0 + t
12 // NOVI: error: invalid operand for instruction
13
14 v_ceil_f32 v1, 1.0 + 1.0
15 // NOVI: error: invalid operand for instruction
16
17 v_ceil_f32 v1, -1.0 + 1.0
18 // NOVI: error: invalid operand for instruction
19
20 //===----------------------------------------------------------------------===//
21 // Constant expressions may be used with SP3 'abs' modifiers |...|
22 // These expressions must be primary expressions to avoid incorrect
23 // interpretation of closing "|".
24 //===----------------------------------------------------------------------===//
25
26 i1=1
27 fm1=0xBF800000 // -1.0f
28 hm1=0xBC00 // -1.0h
29
30 v_ceil_f32 v1, |i1|
31 // VI: v_ceil_f32_e32 v1, 1 ; encoding: [0x81,0x3a,0x02,0x7e]
32
33 v_ceil_f32 v1, |(i1+1)|
34 // VI: v_ceil_f32_e32 v1, 2 ; encoding: [0x82,0x3a,0x02,0x7e]
35
36 v_ceil_f32 v1, |-(i1+1)|
37 // VI: v_ceil_f32_e32 v1, 0x7ffffffe ; encoding: [0xff,0x3a,0x02,0x7e,0xfe,0xff,0xff,0x7f]
38
39 v_ceil_f32 v1, |fm1|
40 // VI: v_ceil_f32_e32 v1, 1.0 ; encoding: [0xf2,0x3a,0x02,0x7e]
41
42 v_mad_f16 v5, v1, v2, |i1|
43 // VI: v_mad_f16 v5, v1, v2, |1| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0x06,0x02]
44
45 v_mad_f16 v5, v1, v2, |(i1+1)|
46 // VI: v_mad_f16 v5, v1, v2, |2| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0x0a,0x02]
47
48 v_mad_f16 v5, v1, v2, |hm1|
49 // VI: v_mad_f16 v5, v1, v2, |-1.0| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0xce,0x03]
50
51 // Only primary expressions are allowed
52
53 v_ceil_f32 v1, |1+i1|
54 // NOVI: failed parsing operand
55
56 v_ceil_f32 v1, |i1+1|
57 // NOVI: failed parsing operand
58
59 //===----------------------------------------------------------------------===//
60 // Constant expressions may be used with 'abs' and 'neg' modifiers.
61 //===----------------------------------------------------------------------===//
62
63 v_ceil_f32 v1, abs(i1)
64 // VI: v_ceil_f32_e32 v1, 1 ; encoding: [0x81,0x3a,0x02,0x7e]
65
66 v_ceil_f32 v1, abs(i1+1)
67 // VI: v_ceil_f32_e32 v1, 2 ; encoding: [0x82,0x3a,0x02,0x7e]
68
69 v_ceil_f32 v1, abs(-(i1+1))
70 // VI: v_ceil_f32_e32 v1, 0x7ffffffe ; encoding: [0xff,0x3a,0x02,0x7e,0xfe,0xff,0xff,0x7f]
71
72 v_ceil_f32 v1, abs(fm1)
73 // VI: v_ceil_f32_e32 v1, 1.0 ; encoding: [0xf2,0x3a,0x02,0x7e]
74
75 v_mad_f16 v5, v1, v2, abs(i1)
76 // VI: v_mad_f16 v5, v1, v2, |1| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0x06,0x02]
77
78 v_mad_f16 v5, v1, v2, abs(i1+1)
79 // VI: v_mad_f16 v5, v1, v2, |2| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0x0a,0x02]
80
81 v_mad_f16 v5, v1, v2, abs(hm1)
82 // VI: v_mad_f16 v5, v1, v2, |-1.0| ; encoding: [0x05,0x04,0xea,0xd1,0x01,0x05,0xce,0x03]
83
84 v_ceil_f32 v1, neg(i1+1)
85 // VI: v_ceil_f32_e32 v1, 0x80000002 ; encoding: [0xff,0x3a,0x02,0x7e,0x02,0x00,0x00,0x80]
86
87 v_ceil_f32 v1, neg(1+i1)
88 // VI: v_ceil_f32_e32 v1, 0x80000002 ; encoding: [0xff,0x3a,0x02,0x7e,0x02,0x00,0x00,0x80]
89
90 v_ceil_f32 v1, neg(-i1+3)
91 // VI: v_ceil_f32_e32 v1, 0x80000002 ; encoding: [0xff,0x3a,0x02,0x7e,0x02,0x00,0x00,0x80]
92
93 v_ceil_f32 v1, neg(-(i1+1))
94 // VI: v_ceil_f32_e32 v1, 0x7ffffffe ; encoding: [0xff,0x3a,0x02,0x7e,0xfe,0xff,0xff,0x7f]
95
96 v_ceil_f32 v1, neg(fm1)
97 // VI: v_ceil_f32_e32 v1, 1.0 ; encoding: [0xf2,0x3a,0x02,0x7e]
98
99 v_mad_f16 v5, v1, v2, neg(hm1)
100 // VI: v_mad_f16 v5, v1, v2, neg(-1.0) ; encoding: [0x05,0x00,0xea,0xd1,0x01,0x05,0xce,0x83]
101
102 //===----------------------------------------------------------------------===//
103 // Constant expressions may be used where inline constants are accepted.
104 //===----------------------------------------------------------------------===//
105
106 v_ceil_f64 v[0:1], i1+1
107 // VI: v_ceil_f64_e32 v[0:1], 2 ; encoding: [0x82,0x30,0x00,0x7e]
108
109 v_and_b32 v0, i1+1, v0
110 // VI: v_and_b32_e32 v0, 2, v0 ; encoding: [0x82,0x00,0x00,0x26]
111
112 v_and_b32 v0, 1+i1, v0
113 // VI: v_and_b32_e32 v0, 2, v0 ; encoding: [0x82,0x00,0x00,0x26]
114
115 v_and_b32 v0, -i1+3, v0
116 // VI: v_and_b32_e32 v0, 2, v0 ; encoding: [0x82,0x00,0x00,0x26]
117
118 v_and_b32 v0, -(i1+1), v0
119 // VI: v_and_b32_e32 v0, -2, v0 ; encoding: [0xc2,0x00,0x00,0x26]
120
121 v_add_u16 v0, (i1+4)/2, v1
122 // VI: v_add_u16_e32 v0, 2, v1 ; encoding: [0x82,0x02,0x00,0x4c]
123
124 buffer_atomic_inc v1, off, s[8:11], i1+1 glc
125 // VI: buffer_atomic_inc v1, off, s[8:11], 2 glc ; encoding: [0x00,0x40,0x2c,0xe1,0x00,0x01,0x02,0x82]
126
127 s_addk_i32 s2, i1+1
128 // VI: s_addk_i32 s2, 0x2 ; encoding: [0x02,0x00,0x02,0xb7]
129
130 s_cmpk_eq_i32 s2, i1+1
131 // VI: s_cmpk_eq_i32 s2, 0x2 ; encoding: [0x02,0x00,0x02,0xb1]
132
133 s_setreg_imm32_b32 0x6, i1+1
134 // VI: s_setreg_imm32_b32 hwreg(HW_REG_LDS_ALLOC, 0, 1), 2 ; encoding: [0x06,0x00,0x00,0xba,0x02,0x00,0x00,0x00]
135
136 v_madak_f16 v1, v2, v3, i1+1
137 // VI: v_madak_f16 v1, v2, v3, 0x2 ; encoding: [0x02,0x07,0x02,0x4a,0x02,0x00,0x00,0x00]
138
139 s_set_gpr_idx_on s0, i1+1
140 // VI: s_set_gpr_idx_on s0, gpr_idx(SRC1) ; encoding: [0x00,0x02,0x11,0xbf]
141
142 s_atc_probe i1-1, s[4:5], i1+1
143 // VI: s_atc_probe 0, s[4:5], 0x2 ; encoding: [0x02,0x00,0x9a,0xc0,0x02,0x00,0x00,0x00]
144
145 s_load_dword s1, s[2:3], i1+1 glc
146 // VI: s_load_dword s1, s[2:3], 0x2 glc ; encoding: [0x41,0x00,0x03,0xc0,0x02,0x00,0x00,0x00]
147
148 //===----------------------------------------------------------------------===//
149 // Constant expressions may be used where literals are accepted.
150 //===----------------------------------------------------------------------===//
151
152 v_ceil_f64 v[0:1], i1+100
153 // VI: v_ceil_f64_e32 v[0:1], 0x65 ; encoding: [0xff,0x30,0x00,0x7e,0x65,0x00,0x00,0x00]
154
155 v_and_b32 v0, i1+100, v0
156 // VI: v_and_b32_e32 v0, 0x65, v0 ; encoding: [0xff,0x00,0x00,0x26,0x65,0x00,0x00,0x00]
157
158 v_and_b32 v0, -i1+102, v0
159 // VI: v_and_b32_e32 v0, 0x65, v0 ; encoding: [0xff,0x00,0x00,0x26,0x65,0x00,0x00,0x00]
160
161 v_add_u16 v0, (i1+100)*2, v0
162 // VI: v_add_u16_e32 v0, 0xca, v0 ; encoding: [0xff,0x00,0x00,0x4c,0xca,0x00,0x00,0x00]
163
164 //===----------------------------------------------------------------------===//
165 // Relocatable expressions can be used with 32-bit instructions.
166 //===----------------------------------------------------------------------===//
167
168 v_ceil_f32 v1, -u
169 // VI: v_ceil_f32_e32 v1, -u ; encoding: [0xff,0x3a,0x02,0x7e,A,A,A,A]
170 // VI-NEXT: ; fixup A - offset: 4, value: -u, kind: FK_PCRel_4
171
172 v_and_b32 v0, u+1, v0
173 // VI: v_and_b32_e32 v0, u+1, v0 ; encoding: [0xff,0x00,0x00,0x26,A,A,A,A]
174 // VI-NEXT: ; fixup A - offset: 4, value: u+1, kind: FK_PCRel_4
175
176 //===----------------------------------------------------------------------===//
177 // Relocatable expressions cannot be used as 16/20/21/64-bit operands.
178 //===----------------------------------------------------------------------===//
179
180 v_ceil_f64 v[0:1], u
181 // NOVI: error: invalid operand for instruction
182
183 v_add_u16 v0, u, v0
184 // NOVI: error: invalid operand for instruction
185
186 s_addk_i32 s2, u
187 // NOVI: error: invalid operand for instruction
188
189 s_load_dword s1, s[2:3], u glc
190 // NOVI: error: invalid operand for instruction
191
192 //===----------------------------------------------------------------------===//
193 // Relocatable expressions cannot be used with VOP3 modifiers.
194 //===----------------------------------------------------------------------===//
195
196 v_ceil_f32 v1, |u|
197 // NOVI: error: expected an absolute expression
198
199 v_ceil_f32 v1, neg(u)
200 // NOVI: error: expected an absolute expression
201
202 v_ceil_f32 v1, abs(u)
203 // NOVI: error: expected an absolute expression
204
205 //===----------------------------------------------------------------------===//
206 // Misc tests with symbols.
207 //===----------------------------------------------------------------------===//
3208
4209 .globl global
5210 .globl gds
38243 // Use a computed expression that results in a non-inline immediate.
39244 .set foo, 512
40245 s_mov_b32 s0, foo+2
41 // VI: s_mov_b32 s0, 514 ; encoding: [0xff,0x00,0x80,0xbe,0x02,0x02,0x00,0x00]
246 // VI: s_mov_b32 s0, 0x202 ; encoding: [0xff,0x00,0x80,0xbe,0x02,0x02,0x00,0x00]
247
248 v_mul_f32 v0, foo+2, v2
249 // VI: v_mul_f32_e32 v0, 0x202, v2 ; encoding: [0xff,0x04,0x00,0x0a,0x02,0x02,0x00,0x00]
42250
43251 BB1:
44252 v_nop_e64
62270 s_sub_u32 s0, s0, -2+t
63271 // VI: s_sub_u32 s0, s0, -1 ; encoding: [0x00,0xc1,0x80,0x80]
64272
65 s_sub_u32 s0, s0, -1.0 + 10000000000
66 // NOVI: error: invalid operand for instruction
67
68 t=10000000000
69 s_sub_u32 s0, s0, 1.0 + t
70 // NOVI: error: invalid operand for instruction
71
72273 //===----------------------------------------------------------------------===//
73274 // Symbols may look like registers.
74275 // They should be allowed in expressions if there is no ambiguity.
76277
77278 v=1
78279 v_sin_f32 v0, -v
79 // NOVI: error: invalid operand for instruction
280 // VI: v_sin_f32_e32 v0, -1 ; encoding: [0xc1,0x52,0x00,0x7e]
281
282 s=1
283 s_not_b32 s0, -s
284 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
285
286 ttmp=1
287 s_not_b32 s0, -ttmp
288 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
289
290 //===----------------------------------------------------------------------===//
291 // Registers have priority over symbols.
292 //===----------------------------------------------------------------------===//
80293
81294 v=1
82295 v_sin_f32 v0, -v[0]
83296 // VI: v_sin_f32_e64 v0, -v0 ; encoding: [0x00,0x00,0x69,0xd1,0x00,0x01,0x00,0x20]
84297
85 s=1
86 s_not_b32 s0, -s
87 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
88
89298 s0=1
90 s_not_b32 s0, -s0
91 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
92
93 ttmp=1
94 s_not_b32 s0, -ttmp
95 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
299 v_sin_f32 v0, -s0
300 // VI: v_sin_f32_e64 v0, -s0 ; encoding: [0x00,0x00,0x69,0xd1,0x00,0x00,0x00,0x20]
96301
97302 ttmp0=1
98 s_not_b32 s0, -[ttmp0]
99 // VI: s_not_b32 s0, -1 ; encoding: [0xc1,0x04,0x80,0xbe]
303 v_sin_f32 v0, -[ttmp0]
304 // VI: v_sin_f32_e64 v0, -ttmp0 ; encoding: [0x00,0x00,0x69,0xd1,0x70,0x00,0x00,0x20]
305
306 //===----------------------------------------------------------------------===//
307 // Incorrect register names and unsupported registers should not be interpreted
308 // as expressions, rather they should trigger errors.
309 //===----------------------------------------------------------------------===//
310
311 s1000=1
312 v_sin_f32 v0, -s1000
313 // NOVI: failed parsing operand
314
315 xnack_mask_lo=1
316 v_sin_f32 v0, xnack_mask_lo
317 // NOVI: failed parsing operand
8888 global_load_dword v1, v[3:4], off offset:0
8989 // GFX10: encoding: [0x00,0x80,0x30,0xdc,0x03,0x00,0x7d,0x01]
9090 // GFX9: global_load_dword v1, v[3:4], off ; encoding: [0x00,0x80,0x50,0xdc,0x03,0x00,0x7f,0x01]
91 // VI-ERR: :41: error: not a valid operand.
91 // VI-ERR: :35: error: not a valid operand.
9292
9393 global_load_dword v1, v[3:4], off offset:4095
9494 // GFX10-ERR: error: invalid operand for instruction
9595 // GFX9: global_load_dword v1, v[3:4], off offset:4095 ; encoding: [0xff,0x8f,0x50,0xdc,0x03,0x00,0x7f,0x01]
96 // VI-ERR: :41: error: not a valid operand.
96 // VI-ERR: :35: error: not a valid operand.
9797
9898 global_load_dword v1, v[3:4], off offset:-1
9999 // GFX10: encoding: [0xff,0x8f,0x30,0xdc,0x03,0x00,0x7d,0x01]
100100 // GFX9: global_load_dword v1, v[3:4], off offset:-1 ; encoding: [0xff,0x9f,0x50,0xdc,0x03,0x00,0x7f,0x01]
101 // VI-ERR: :41: error: not a valid operand.
101 // VI-ERR: :35: error: not a valid operand.
102102
103103 global_load_dword v1, v[3:4], off offset:-4096
104104 // GFX10-ERR: error: invalid operand for instruction
105105 // GFX9: global_load_dword v1, v[3:4], off offset:-4096 ; encoding: [0x00,0x90,0x50,0xdc,0x03,0x00,0x7f,0x01]
106 // VI-ERR: :41: error: not a valid operand.
106 // VI-ERR: :35: error: not a valid operand.
107107
108108 global_load_dword v1, v[3:4], off offset:4096
109109 // GFX10-ERR: error: invalid operand for instruction
110110 // GFX9-ERR: :35: error: invalid operand for instruction
111 // VI-ERR: :41: error: not a valid operand.
111 // VI-ERR: :35: error: not a valid operand.
112112
113113 global_load_dword v1, v[3:4] off, offset:-4097
114114 // GFX10-ERR: error: invalid operand for instruction
115115 // GFX9-ERR: :35: error: invalid operand for instruction
116 // VI-ERR: :41: error: not a valid operand.
116 // VI-ERR: :35: error: not a valid operand.
117117
118118 global_store_byte v[3:4], v1, off
119119 // GFX10: encoding: [0x00,0x80,0x60,0xdc,0x03,0x01,0x7d,0x00]
178178 global_store_dword v[3:4], v1, off offset:12
179179 // GFX10: encoding: [0x0c,0x80,0x70,0xdc,0x03,0x01,0x7d,0x00]
180180 // GFX9: global_store_dword v[3:4], v1, off offset:12 ; encoding: [0x0c,0x80,0x70,0xdc,0x03,0x01,0x7f,0x00]
181 // VI-ERR: :42: error: not a valid operand
181 // VI-ERR: :36: error: not a valid operand
182182
183183 global_load_dword v1, v[3:4], s[2:3]
184184 // GFX10: encoding: [0x00,0x80,0x30,0xdc,0x03,0x00,0x02,0x01]
188188 global_load_dword v1, v[3:4], s[2:3] offset:24
189189 // GFX10: encoding: [0x18,0x80,0x30,0xdc,0x03,0x00,0x02,0x01]
190190 // GFX9: global_load_dword v1, v[3:4], s[2:3] offset:24 ; encoding: [0x18,0x80,0x50,0xdc,0x03,0x00,0x02,0x01]
191 // VI-ERR: :44: error: not a valid operand.
191 // VI-ERR: :38: error: not a valid operand.
192192
193193 global_load_dword v1, v[3:4], s[2:3] offset:-8
194194 // GFX10: encoding: [0xf8,0x8f,0x30,0xdc,0x03,0x00,0x02,0x01]
195195 // GFX9: global_load_dword v1, v[3:4], s[2:3] offset:-8 ; encoding: [0xf8,0x9f,0x50,0xdc,0x03,0x00,0x02,0x01]
196 // VI-ERR: :44: error: not a valid operand.
196 // VI-ERR: :38: error: not a valid operand.
197197
198198 global_store_dword v[3:4], v1, s[2:3]
199199 // GFX10: encoding: [0x00,0x80,0x70,0xdc,0x03,0x01,0x02,0x00]
203203 global_store_dword v[3:4], v1, s[2:3] offset:24
204204 // GFX10: encoding: [0x18,0x80,0x70,0xdc,0x03,0x01,0x02,0x00]
205205 // GFX9: global_store_dword v[3:4], v1, s[2:3] offset:24 ; encoding: [0x18,0x80,0x70,0xdc,0x03,0x01,0x02,0x00]
206 // VI-ERR: :45: error: not a valid operand.
206 // VI-ERR: :39: error: not a valid operand.
207207
208208 global_store_dword v[3:4], v1, s[2:3] offset:-8
209209 // GFX10: encoding: [0xf8,0x8f,0x70,0xdc,0x03,0x01,0x02,0x00]
210210 // GFX9: global_store_dword v[3:4], v1, s[2:3] offset:-8 ; encoding: [0xf8,0x9f,0x70,0xdc,0x03,0x01,0x02,0x00]
211 // VI-ERR: :45: error: not a valid operand.
211 // VI-ERR: :39: error: not a valid operand.
212212
213213 // XXX: Is this valid?
214214 global_store_dword v[3:4], v1, exec
359359 global_atomic_cmpswap v[3:4], v[5:6], off offset:-16
360360 // GFX10: encoding: [0xf0,0x8f,0xc4,0xdc,0x03,0x05,0x7d,0x00]
361361 // GFX9: global_atomic_cmpswap v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x04,0xdd,0x03,0x05,0x7f,0x00]
362 // VI-ERR: :49: error: not a valid operand.
362 // VI-ERR: :43: error: not a valid operand.
363363
364364 global_atomic_cmpswap_x2 v[3:4], v[5:8], off offset:-16
365365 // GFX10: encoding: [0xf0,0x8f,0x44,0xdd,0x03,0x05,0x7d,0x00]
366366 // GFX9: global_atomic_cmpswap_x2 v[3:4], v[5:8], off offset:-16 ; encoding: [0xf0,0x9f,0x84,0xdd,0x03,0x05,0x7f,0x00]
367 // VI-ERR: :52: error: not a valid operand.
367 // VI-ERR: :46: error: not a valid operand.
368368
369369 global_atomic_swap v[3:4], v5, off offset:-16
370370 // GFX10: encoding: [0xf0,0x8f,0xc0,0xdc,0x03,0x05,0x7d,0x00]
371371 // GFX9: global_atomic_swap v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x00,0xdd,0x03,0x05,0x7f,0x00]
372 // VI-ERR: :42: error: not a valid operand
372 // VI-ERR: :36: error: not a valid operand
373373
374374 global_atomic_swap_x2 v[3:4], v[5:6], off offset:-16
375375 // GFX10: encoding: [0xf0,0x8f,0x40,0xdd,0x03,0x05,0x7d,0x00]
376376 // GFX9: global_atomic_swap_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x80,0xdd,0x03,0x05,0x7f,0x00]
377 // VI-ERR: :49: error: not a valid operand
377 // VI-ERR: :43: error: not a valid operand
378378
379379 global_atomic_add v[3:4], v5, off offset:-16
380380 // GFX10: encoding: [0xf0,0x8f,0xc8,0xdc,0x03,0x05,0x7d,0x00]
381381 // GFX9: global_atomic_add v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x08,0xdd,0x03,0x05,0x7f,0x00]
382 // VI-ERR: :41: error: not a valid operand
382 // VI-ERR: :35: error: not a valid operand
383383
384384 global_atomic_sub v[3:4], v5, off offset:-16
385385 // GFX10: encoding: [0xf0,0x8f,0xcc,0xdc,0x03,0x05,0x7d,0x00]
386386 // GFX9: global_atomic_sub v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x0c,0xdd,0x03,0x05,0x7f,0x00]
387 // VI-ERR: :41: error: not a valid operand
387 // VI-ERR: :35: error: not a valid operand
388388
389389 global_atomic_smin v[3:4], v5, off offset:-16
390390 // GFX10: encoding: [0xf0,0x8f,0xd4,0xdc,0x03,0x05,0x7d,0x00]
391391 // GFX9: global_atomic_smin v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x10,0xdd,0x03,0x05,0x7f,0x00]
392 // VI-ERR: :42: error: not a valid operand
392 // VI-ERR: :36: error: not a valid operand
393393
394394 global_atomic_umin v[3:4], v5, off offset:-16
395395 // GFX10: encoding: [0xf0,0x8f,0xd8,0xdc,0x03,0x05,0x7d,0x00]
396396 // GFX9: global_atomic_umin v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x14,0xdd,0x03,0x05,0x7f,0x00]
397 // VI-ERR: :42: error: not a valid operand
397 // VI-ERR: :36: error: not a valid operand
398398
399399 global_atomic_smax v[3:4], v5, off offset:-16
400400 // GFX10: encoding: [0xf0,0x8f,0xdc,0xdc,0x03,0x05,0x7d,0x00]
401401 // GFX9: global_atomic_smax v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x18,0xdd,0x03,0x05,0x7f,0x00]
402 // VI-ERR: :42: error: not a valid operand
402 // VI-ERR: :36: error: not a valid operand
403403
404404 global_atomic_umax v[3:4], v5, off offset:-16
405405 // GFX10: encoding: [0xf0,0x8f,0xe0,0xdc,0x03,0x05,0x7d,0x00]
406406 // GFX9: global_atomic_umax v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x1c,0xdd,0x03,0x05,0x7f,0x00]
407 // VI-ERR: :42: error: not a valid operand
407 // VI-ERR: :36: error: not a valid operand
408408
409409 global_atomic_and v[3:4], v5, off offset:-16
410410 // GFX10: encoding: [0xf0,0x8f,0xe4,0xdc,0x03,0x05,0x7d,0x00]
411411 // GFX9: global_atomic_and v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x20,0xdd,0x03,0x05,0x7f,0x00]
412 // VI-ERR: :41: error: not a valid operand
412 // VI-ERR: :35: error: not a valid operand
413413
414414 global_atomic_or v[3:4], v5, off offset:-16
415415 // GFX10: encoding: [0xf0,0x8f,0xe8,0xdc,0x03,0x05,0x7d,0x00]
416416 // GFX9: global_atomic_or v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x24,0xdd,0x03,0x05,0x7f,0x00]
417 // VI-ERR: :40: error: not a valid operand
417 // VI-ERR: :34: error: not a valid operand
418418
419419 global_atomic_xor v[3:4], v5, off offset:-16
420420 // GFX10: encoding: [0xf0,0x8f,0xec,0xdc,0x03,0x05,0x7d,0x00]
421421 // GFX9: global_atomic_xor v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x28,0xdd,0x03,0x05,0x7f,0x00]
422 // VI-ERR: :41: error: not a valid operand
422 // VI-ERR: :35: error: not a valid operand
423423
424424 global_atomic_inc v[3:4], v5, off offset:-16
425425 // GFX10: encoding: [0xf0,0x8f,0xf0,0xdc,0x03,0x05,0x7d,0x00]
426426 // GFX9: global_atomic_inc v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x2c,0xdd,0x03,0x05,0x7f,0x00]
427 // VI-ERR: :41: error: not a valid operand
427 // VI-ERR: :35: error: not a valid operand
428428
429429 global_atomic_dec v[3:4], v5, off offset:-16
430430 // GFX10: encoding: [0xf0,0x8f,0xf4,0xdc,0x03,0x05,0x7d,0x00]
431431 // GFX9: global_atomic_dec v[3:4], v5, off offset:-16 ; encoding: [0xf0,0x9f,0x30,0xdd,0x03,0x05,0x7f,0x00]
432 // VI-ERR: :41: error: not a valid operand
432 // VI-ERR: :35: error: not a valid operand
433433
434434 global_atomic_add_x2 v[3:4], v[5:6], off offset:-16
435435 // GFX10: encoding: [0xf0,0x8f,0x48,0xdd,0x03,0x05,0x7d,0x00]
436436 // GFX9: global_atomic_add_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x88,0xdd,0x03,0x05,0x7f,0x00]
437 // VI-ERR: :48: error: not a valid operand
437 // VI-ERR: :42: error: not a valid operand
438438
439439 global_atomic_sub_x2 v[3:4], v[5:6], off offset:-16
440440 // GFX10: encoding: [0xf0,0x8f,0x4c,0xdd,0x03,0x05,0x7d,0x00]
441441 // GFX9: global_atomic_sub_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x8c,0xdd,0x03,0x05,0x7f,0x00]
442 // VI-ERR: :48: error: not a valid operand
442 // VI-ERR: :42: error: not a valid operand
443443
444444 global_atomic_smin_x2 v[3:4], v[5:6], off offset:-16
445445 // GFX10: encoding: [0xf0,0x8f,0x54,0xdd,0x03,0x05,0x7d,0x00]
446446 // GFX9: global_atomic_smin_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x90,0xdd,0x03,0x05,0x7f,0x00]
447 // VI-ERR: :49: error: not a valid operand
447 // VI-ERR: :43: error: not a valid operand
448448
449449 global_atomic_umin_x2 v[3:4], v[5:6], off offset:-16
450450 // GFX10: encoding: [0xf0,0x8f,0x58,0xdd,0x03,0x05,0x7d,0x00]
451451 // GFX9: global_atomic_umin_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x94,0xdd,0x03,0x05,0x7f,0x00]
452 // VI-ERR: :49: error: not a valid operand
452 // VI-ERR: :43: error: not a valid operand
453453
454454 global_atomic_smax_x2 v[3:4], v[5:6], off offset:-16
455455 // GFX10: encoding: [0xf0,0x8f,0x5c,0xdd,0x03,0x05,0x7d,0x00]
456456 // GFX9: global_atomic_smax_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x98,0xdd,0x03,0x05,0x7f,0x00]
457 // VI-ERR: :49: error: not a valid operand
457 // VI-ERR: :43: error: not a valid operand
458458
459459 global_atomic_umax_x2 v[3:4], v[5:6], off offset:-16
460460 // GFX10: encoding: [0xf0,0x8f,0x60,0xdd,0x03,0x05,0x7d,0x00]
461461 // GFX9: global_atomic_umax_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0x9c,0xdd,0x03,0x05,0x7f,0x00]
462 // VI-ERR: :49: error: not a valid operand
462 // VI-ERR: :43: error: not a valid operand
463463
464464 global_atomic_and_x2 v[3:4], v[5:6], off offset:-16
465465 // GFX10: encoding: [0xf0,0x8f,0x64,0xdd,0x03,0x05,0x7d,0x00]
466466 // GFX9: global_atomic_and_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0xa0,0xdd,0x03,0x05,0x7f,0x00]
467 // VI-ERR: :48: error: not a valid operand
467 // VI-ERR: :42: error: not a valid operand
468468
469469 global_atomic_or_x2 v[3:4], v[5:6], off offset:-16
470470 // GFX10: encoding: [0xf0,0x8f,0x68,0xdd,0x03,0x05,0x7d,0x00]
471471 // GFX9: global_atomic_or_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0xa4,0xdd,0x03,0x05,0x7f,0x00]
472 // VI-ERR: :47: error: not a valid operand
472 // VI-ERR: :41: error: not a valid operand
473473
474474 global_atomic_xor_x2 v[3:4], v[5:6], off offset:-16
475475 // GFX10: encoding: [0xf0,0x8f,0x6c,0xdd,0x03,0x05,0x7d,0x00]
476476 // GFX9: global_atomic_xor_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0xa8,0xdd,0x03,0x05,0x7f,0x00]
477 // VI-ERR: :48: error: not a valid operand
477 // VI-ERR: :42: error: not a valid operand
478478
479479 global_atomic_inc_x2 v[3:4], v[5:6], off offset:-16
480480 // GFX10: encoding: [0xf0,0x8f,0x70,0xdd,0x03,0x05,0x7d,0x00]
481481 // GFX9: global_atomic_inc_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0xac,0xdd,0x03,0x05,0x7f,0x00]
482 // VI-ERR: :48: error: not a valid operand
482 // VI-ERR: :42: error: not a valid operand
483483
484484 global_atomic_dec_x2 v[3:4], v[5:6], off offset:-16
485485 // GFX10: encoding: [0xf0,0x8f,0x74,0xdd,0x03,0x05,0x7d,0x00]
486486 // GFX9: global_atomic_dec_x2 v[3:4], v[5:6], off offset:-16 ; encoding: [0xf0,0x9f,0xb0,0xdd,0x03,0x05,0x7f,0x00]
487 // VI-ERR: :48: error: not a valid operand
487 // VI-ERR: :42: error: not a valid operand
488488
489489 global_load_ubyte_d16 v1, v[3:4], off
490490 // GFX10: encoding: [0x00,0x80,0x80,0xdc,0x03,0x00,0x7d,0x01]
99 # CHECK-NEXT: v2, v4, v6
1010 # CHECK-NEXT: ^
1111
12 # CHECK: error: not a valid operand.
12 # CHECK: error: failed parsing operand
1313 # CHECK-NEXT: v2, v4, v6
1414 # CHECK-NEXT: ^
1515
521521 // named inline values like shared_base
522522 //---------------------------------------------------------------------------//
523523
524 // NOSICIVI: error: not a valid operand.
524 // NOSICIVI: error: failed parsing operand.
525525 // GFX9: buffer_atomic_add v0, off, s[0:3], src_shared_base offset:4095 ; encoding: [0xff,0x0f,0x08,0xe1,0x00,0x00,0x00,0xeb]
526526 buffer_atomic_add v0, off, s[0:3], src_shared_base offset:4095
527527
528 // NOSICIVI: error: not a valid operand.
528 // NOSICIVI: error: failed parsing operand.
529529 // GFX9: s_add_i32 s0, src_shared_base, s0 ; encoding: [0xeb,0x00,0x00,0x81]
530530 s_add_i32 s0, src_shared_base, s0
531531
532 // NOSICIVI: error: not a valid operand.
532 // NOSICIVI: error: failed parsing operand.
533533 // GFX9: s_add_i32 s0, src_shared_limit, s0 ; encoding: [0xec,0x00,0x00,0x81]
534534 s_add_i32 s0, src_shared_limit, s0
535535
536 // NOSICIVI: error: not a valid operand.
536 // NOSICIVI: error: failed parsing operand.
537537 // GFX9: s_add_i32 s0, src_private_base, s0 ; encoding: [0xed,0x00,0x00,0x81]
538538 s_add_i32 s0, src_private_base, s0
539539
540 // NOSICIVI: error: not a valid operand.
540 // NOSICIVI: error: failed parsing operand.
541541 // GFX9: s_add_i32 s0, src_private_limit, s0 ; encoding: [0xee,0x00,0x00,0x81]
542542 s_add_i32 s0, src_private_limit, s0
543543
544 // NOSICIVI: error: not a valid operand.
544 // NOSICIVI: error: failed parsing operand.
545545 // GFX9: s_add_i32 s0, src_pops_exiting_wave_id, s0 ; encoding: [0xef,0x00,0x00,0x81]
546546 s_add_i32 s0, src_pops_exiting_wave_id, s0
547547
548 // NOSICIVI: error: not a valid operand.
548 // NOSICIVI: error: failed parsing operand.
549549 // GFX9: s_and_b64 s[0:1], s[0:1], src_shared_base ; encoding: [0x00,0xeb,0x80,0x86]
550550 s_and_b64 s[0:1], s[0:1], src_shared_base
551551
552 // NOSICIVI: error: not a valid operand.
552 // NOSICIVI: error: failed parsing operand.
553553 // GFX9: s_and_b64 s[0:1], s[0:1], src_shared_limit ; encoding: [0x00,0xec,0x80,0x86]
554554 s_and_b64 s[0:1], s[0:1], src_shared_limit
555555
556 // NOSICIVI: error: not a valid operand.
556 // NOSICIVI: error: failed parsing operand.
557557 // GFX9: s_and_b64 s[0:1], s[0:1], src_private_base ; encoding: [0x00,0xed,0x80,0x86]
558558 s_and_b64 s[0:1], s[0:1], src_private_base
559559
560 // NOSICIVI: error: not a valid operand.
560 // NOSICIVI: error: failed parsing operand.
561561 // GFX9: s_and_b64 s[0:1], s[0:1], src_private_limit ; encoding: [0x00,0xee,0x80,0x86]
562562 s_and_b64 s[0:1], s[0:1], src_private_limit
563563
564 // NOSICIVI: error: not a valid operand.
564 // NOSICIVI: error: failed parsing operand.
565565 // GFX9: s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id ; encoding: [0x00,0xef,0x80,0x86]
566566 s_and_b64 s[0:1], s[0:1], src_pops_exiting_wave_id
567567
568 // NOSICIVI: error: not a valid operand.
568 // NOSICIVI: error: failed parsing operand.
569569 // GFX9: v_add_u16_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x4c]
570570 v_add_u16 v0, src_shared_base, v0
571571
572 // NOSICIVI: error: not a valid operand.
572 // NOSICIVI: error: failed parsing operand.
573573 // GFX9: v_add_u16_sdwa v0, src_shared_base, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x00,0x00,0x4c,0xeb,0x06,0x86,0x06]
574574 v_add_u16_sdwa v0, src_shared_base, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
575575
576 // NOSICIVI: error: not a valid operand.
576 // NOSICIVI: error: failed parsing operand.
577577 // GFX9: v_add_u16_sdwa v0, v0, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0xd6,0x01,0x4c,0x00,0x06,0x06,0x86]
578578 v_add_u16_sdwa v0, v0, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
579579
580 // NOSICIVI: error: not a valid operand.
580 // NOSICIVI: error: failed parsing operand.
581581 // GFX9: v_add_u32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x68]
582582 v_add_u32 v0, src_shared_base, v0
583583
584 // NOSICIVI: error: not a valid operand.
584 // NOSICIVI: error: failed parsing operand.
585585 // GFX9: v_add_u32_e64 v0, src_shared_base, v0 ; encoding: [0x00,0x00,0x34,0xd1,0xeb,0x00,0x02,0x00]
586586 v_add_u32_e64 v0, src_shared_base, v0
587587
588 // NOSICIVI: error: not a valid operand.
588 // NOSICIVI: error: failed parsing operand.
589589 // GFX9: v_cmp_eq_i64_e32 vcc, src_shared_base, v[0:1] ; encoding: [0xeb,0x00,0xc4,0x7d]
590590 v_cmp_eq_i64 vcc, src_shared_base, v[0:1]
591591
592 // NOSICIVI: error: not a valid operand.
592 // NOSICIVI: error: failed parsing operand.
593593 // GFX9: v_max_f16_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x5a]
594594 v_max_f16 v0, src_shared_base, v0
595595
596 // NOSICIVI: error: not a valid operand.
596 // NOSICIVI: error: failed parsing operand.
597597 // GFX9: v_max_f32_e32 v0, src_shared_base, v0 ; encoding: [0xeb,0x00,0x00,0x16]
598598 v_max_f32 v0, src_shared_base, v0
599599
600 // NOSICIVI: error: not a valid operand.
600 // NOSICIVI: error: failed parsing operand.
601601 // GFX9: v_max_f64 v[0:1], src_shared_base, v[0:1] ; encoding: [0x00,0x00,0x83,0xd2,0xeb,0x00,0x02,0x00]
602602 v_max_f64 v[0:1], src_shared_base, v[0:1]
603603
604 // NOSICIVI: error: not a valid operand.
604 // NOSICIVI: error: failed parsing operand.
605605 // GFX9: v_pk_add_f16 v0, src_shared_base, v0 ; encoding: [0x00,0x00,0x8f,0xd3,0xeb,0x00,0x02,0x18]
606606 v_pk_add_f16 v0, src_shared_base, v0
607607
608 // NOSICI: error: invalid operand for instruction
609 // NOVI: error: not a valid operand.
608 // NOSICI: error: not a valid operand
609 // NOVI: error: failed parsing operand.
610610 // GFX9: v_ceil_f16_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x85,0xd1,0xeb,0x00,0x00,0x20]
611611 v_ceil_f16 v0, neg(src_shared_base)
612612
613 // NOSICI: error: invalid operand for instruction
614 // NOVI: error: not a valid operand.
613 // NOSICI: error: not a valid operand
614 // NOVI: error: failed parsing operand.
615615 // GFX9: v_ceil_f16_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x85,0xd1,0xeb,0x00,0x00,0x00]
616616 v_ceil_f16 v0, abs(src_shared_base)
617617
618 // NOSICIVI: error: not a valid operand.
618 // NOSOCIVI: error: failed parsing operand.
619619 // GFX9: v_ceil_f64_e64 v[5:6], |src_shared_base| ; encoding: [0x05,0x01,0x58,0xd1,0xeb,0x00,0x00,0x00]
620620 v_ceil_f64 v[5:6], |src_shared_base|
621621
622 // NOSI: error: invalid operand for instruction
623 // NOCIVI: error: not a valid operand.
622 // NOSI: error: not a valid operand
623 // NOCIVI: error: failed parsing operand.
624624 // GFX9: v_ceil_f64_e64 v[5:6], -src_shared_base ; encoding: [0x05,0x00,0x58,0xd1,0xeb,0x00,0x00,0x20]
625625 v_ceil_f64 v[5:6], -src_shared_base
626626
627 // NOSICIVI: error: not a valid operand.
627 // NOSICIVI: error: failed parsing operand.
628628 // GFX9: v_ceil_f32_e64 v0, -src_shared_base ; encoding: [0x00,0x00,0x5d,0xd1,0xeb,0x00,0x00,0x20]
629629 v_ceil_f32 v0, -src_shared_base
630630
631 // NOSICIVI: error: not a valid operand.
631 // NOSICIVI: error: failed parsing operand.
632632 // GFX9: v_ceil_f32_e64 v0, |src_shared_base| ; encoding: [0x00,0x01,0x5d,0xd1,0xeb,0x00,0x00,0x00]
633633 v_ceil_f32 v0, |src_shared_base|
634634
635 // NOSICIVI: error: not a valid operand.
635 // NOSICI: error: not a valid operand.
636 // NOVI: error: failed parsing operand.
636637 // GFX9: v_ceil_f16_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0xa6,0x00]
637638 v_ceil_f16_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE
638639
639 // NOSICIVI: error: not a valid operand.
640 // NOSICI: error: not a valid operand.
641 // NOVI: error: failed parsing operand.
640642 // GFX9: v_ceil_f16_sdwa v5, -src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x8a,0x0a,0x7e,0xeb,0x16,0x96,0x00]
641643 v_ceil_f16_sdwa v5, -src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE
642644
643 // NOSICIVI: error: not a valid operand.
645 // NOSICIVI: error: failed parsing operand.
644646 // GFX9: v_ceil_f32_sdwa v5, src_shared_base dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0x86,0x00]
645647 v_ceil_f32_sdwa v5, src_shared_base dst_sel:DWORD src0_sel:DWORD
646648
647 // NOSICIVI: error: not a valid operand.
649 // NOSICIVI: error: failed parsing operand.
648650 // GFX9: v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x3a,0x0a,0x7e,0xeb,0x16,0xa6,0x00]
649651 v_ceil_f32_sdwa v5, |src_shared_base| dst_sel:DWORD src0_sel:DWORD
650652
652654 // named inline values compete with other scalars for constant bus access
653655 //---------------------------------------------------------------------------//
654656
655 // NOSICIVI: error: not a valid operand.
657 // NOSICIVI: error: failed parsing operand.
656658 // NOGFX9: error: invalid operand (violates constant bus restrictions)
657659 v_add_u32 v0, private_base, s0
658660
659661 // v_div_fmas implicitly reads VCC
660 // NOSICIVI: error: not a valid operand.
662 // NOSICIVI: error: failed parsing operand.
661663 // NOGFX9: error: invalid operand (violates constant bus restrictions)
662664 v_div_fmas_f32 v0, shared_base, v0, v1
663665
664666 // v_div_fmas implicitly reads VCC
665 // NOSICIVI: error: not a valid operand.
667 // NOSICIVI: error: failed parsing operand.
666668 // NOGFX9: error: invalid operand (violates constant bus restrictions)
667669 v_div_fmas_f32 v0, v0, shared_limit, v1
668670
669671 // v_div_fmas implicitly reads VCC
670 // NOSICIVI: error: not a valid operand.
672 // NOSICIVI: error: failed parsing operand.
671673 // NOGFX9: error: invalid operand (violates constant bus restrictions)
672674 v_div_fmas_f32 v0, v0, v1, private_limit
673675
674676 // v_addc_co_u32 implicitly reads VCC (VOP2)
675 // NOSICIVI: error: not a valid operand.
677 // NOSICIVI: error: failed parsing operand.
676678 // NOGFX9: error: invalid operand (violates constant bus restrictions)
677679 v_addc_co_u32 v0, vcc, shared_base, v0, vcc
678680
679 // NOSICIVI: error: not a valid operand.
681 // NOSICIVI: error: failed parsing operand.
680682 // NOGFX9: error: invalid operand (violates constant bus restrictions)
681683 v_madak_f32 v0, shared_base, v0, 0x11213141
682684
683 // NOSICIVI: error: not a valid operand.
685 // NOSICIVI: error: failed parsing operand.
684686 // NOGFX9: error: invalid operand (violates constant bus restrictions)
685687 v_cmp_eq_f32 s[0:1], private_base, private_limit
686688
687 // NOSICIVI: error: not a valid operand.
689 // NOSICIVI: error: failed parsing operand.
688690 // NOGFX9: error: invalid operand (violates constant bus restrictions)
689691 v_cmp_eq_f32 s[0:1], private_base, s0
690692
691 // NOSICIVI: error: not a valid operand.
693 // NOSICIVI: error: failed parsing operand.
692694 // NOGFX9: error: invalid operand (violates constant bus restrictions)
693695 v_pk_add_f16 v255, private_base, private_limit
659659 // VI: v_interp_p1_f32_e64 v5, v2, attr0.y ; encoding: [0x05,0x00,0x70,0xd2,0x40,0x04,0x02,0x00]
660660
661661 v_interp_p1_f32_e64 v5, -v2, attr0.x
662 // NOSICI: error: invalid operand for instruction
662 // NOSICI: error: not a valid operand
663663 // VI: v_interp_p1_f32_e64 v5, -v2, attr0.x ; encoding: [0x05,0x00,0x70,0xd2,0x00,0x04,0x02,0x40]
664664
665665 v_interp_p1_f32_e64 v5, |v2|, attr0.x
688688 // VI: v_interp_p2_f32_e64 v5, v2, attr31.x ; encoding: [0x05,0x00,0x71,0xd2,0x1f,0x04,0x02,0x00]
689689
690690 v_interp_p2_f32_e64 v5, -v2, attr0.x
691 // NOSICI: error: invalid operand for instruction
691 // NOSICI: error: not a valid operand
692692 // VI: v_interp_p2_f32_e64 v5, -v2, attr0.x ; encoding: [0x05,0x00,0x71,0xd2,0x00,0x04,0x02,0x40]
693693
694694 v_interp_p2_f32_e64 v5, |v2|, attr0.x
713713 // VI: v_interp_p1ll_f16 v5, v2, attr0.w ; encoding: [0x05,0x00,0x74,0xd2,0xc0,0x04,0x02,0x00]
714714
715715 v_interp_p1ll_f16 v5, -v2, attr0.x
716 // NOSICI: error: invalid operand for instruction
716 // NOSICI: error: not a valid operand
717717 // VI: v_interp_p1ll_f16 v5, -v2, attr0.x ; encoding: [0x05,0x00,0x74,0xd2,0x00,0x04,0x02,0x40]
718718
719719 v_interp_p1ll_f16 v5, |v2|, attr0.x
742742 // VI: v_interp_p1lv_f16 v5, v2, attr0.z, v3 ; encoding: [0x05,0x00,0x75,0xd2,0x80,0x04,0x0e,0x04]
743743
744744 v_interp_p1lv_f16 v5, -v2, attr0.x, v3
745 // NOSICI: error: invalid operand for instruction
745 // NOSICI: error: not a valid operand
746746 // VI: v_interp_p1lv_f16 v5, -v2, attr0.x, v3 ; encoding: [0x05,0x00,0x75,0xd2,0x00,0x04,0x0e,0x44]
747747
748748 v_interp_p1lv_f16 v5, v2, attr0.x, -v3
749 // NOSICI: error: invalid operand for instruction
749 // NOSICI: error: not a valid operand
750750 // VI: v_interp_p1lv_f16 v5, v2, attr0.x, -v3 ; encoding: [0x05,0x00,0x75,0xd2,0x00,0x04,0x0e,0x84]
751751
752752 v_interp_p1lv_f16 v5, |v2|, attr0.x, v3
787787 // VI: v_interp_p2_f16 v5, v2, attr0.w, v3 ; encoding: [0x05,0x00,0x76,0xd2,0xc0,0x04,0x0e,0x04]
788788
789789 v_interp_p2_f16 v5, -v2, attr0.x, v3
790 // NOSICI: error: invalid operand for instruction
790 // NOSICI: error: not a valid operand
791791 // VI: v_interp_p2_f16 v5, -v2, attr0.x, v3 ; encoding: [0x05,0x00,0x76,0xd2,0x00,0x04,0x0e,0x44]
792792
793793 v_interp_p2_f16 v5, v2, attr0.x, -v3
794 // NOSICI: error: invalid operand for instruction
794 // NOSICI: error: not a valid operand
795795 // VI: v_interp_p2_f16 v5, v2, attr0.x, -v3 ; encoding: [0x05,0x00,0x76,0xd2,0x00,0x04,0x0e,0x84]
796796
797797 v_interp_p2_f16 v5, |v2|, attr0.x, v3
3535 // GFX9: 35: error: failed parsing operand.
3636 v_pk_add_u16 v1, v2, v3 op_sel:[0,-1]
3737
38 // GFX9: 42: error: not a valid operand.
38 // GFX9: 42: error: failed parsing operand.
3939 v_pk_add_u16 v1, v2, v3 op_sel:[0,0,0,0,0]
4040
4141 // XXGFX9: invalid operand for instruction
4949 // GFX9: :18: error: not a valid operand.
5050 v_pk_add_f16 v1, |v2|, v3
5151
52 // GFX9: :18: error: invalid operand for instruction
52 // GFX9: :18: error: not a valid operand
5353 v_pk_add_f16 v1, abs(v2), v3
5454
5555 // GFX9: :22: error: not a valid operand.
5656 v_pk_add_f16 v1, v2, |v3|
5757
58 // GFX9: :22: error: invalid operand for instruction
58 // GFX9: :22: error: not a valid operand.
5959 v_pk_add_f16 v1, v2, abs(v3)
6060
61 // GFX9: :18: error: invalid operand for instruction
61 // GFX9: :18: error: not a valid operand.
6262 v_pk_add_f16 v1, -v2, v3
6363
64 // GFX9: :22: error: invalid operand for instruction
64 // GFX9: :22: error: not a valid operand.
6565 v_pk_add_f16 v1, v2, -v3
6666
67 // GFX9: :18: error: invalid operand for instruction
67 // GFX9: :18: error: not a valid operand.
6868 v_pk_add_u16 v1, abs(v2), v3
6969
70 // GFX9: :18: error: invalid operand for instruction
70 // GFX9: :18: error: not a valid operand.
7171 v_pk_add_u16 v1, -v2, v3
7272
7373 //
590590 v_cndmask_b32_sdwa v5, -1, v2, vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
591591
592592 // NOSICI: error
593 // NOVI: error
594 // GFX9: v_cndmask_b32_sdwa v5, v1, sext(v2), vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0x01,0x06,0x06,0x0e]
593 // GFX89: v_cndmask_b32_sdwa v5, v1, sext(v2), vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD ; encoding: [0xf9,0x04,0x0a,0x00,0x01,0x06,0x06,0x0e]
595594 v_cndmask_b32_sdwa v5, v1, sext(v2), vcc dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
596595
597596 //===----------------------------------------------------------------------===//
11131112 // NOGFX89: error: invalid operand for instruction
11141113 v_add_f32 v0, s0, v[0:3] dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2
11151114
1116 // NOSICI: error: invalid operand for instruction
1115 // NOSICI: error: not a valid operand
11171116 // NOGFX89: error: invalid operand for instruction
11181117 v_add_f16 v1, v[2:3], v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2
11191118
1120 // NOSICI: error: invalid operand for instruction
1119 // NOSICI: error: not a valid operand
11211120 // NOGFX89: error: invalid operand for instruction
11221121 v_add_f16 v1, s[2:3], v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2
11231122
1124 // NOSICI: error: invalid operand for instruction
1123 // NOSICI: error: not a valid operand
11251124 // NOGFX89: error: invalid operand for instruction
11261125 v_add_f16 v1, v2, v[2:3] dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2
11271126
1128 // NOSICI: error: invalid operand for instruction
1127 // NOSICI: error: not a valid operand
11291128 // NOGFX89: error: invalid operand for instruction
11301129 v_add_f16 v1, v2, s[2:3] dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 src1_sel:BYTE_2
11311130