llvm.org GIT mirror llvm / b554ed7
[X86][AsmParser][AVX512] Error appropriately when K0 is tried as a write-mask K0 isn't expected as a write-mask, so provide a detailed error here, instead of the more generic one (invalid op for insn) Conforms with gas Differential Revision: https://reviews.llvm.org/D36570 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310789 91177308-0d34-0410-b5e6-96231b3b80d8 Coby Tayree 2 years ago
3 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
20872087 // Parse an op-mask register mark ({%k}), which is now to be
20882088 // expected
20892089 unsigned RegNo;
2090 if (!ParseRegister(RegNo, StartLoc, StartLoc) &&
2090 SMLoc RegLoc;
2091 if (!ParseRegister(RegNo, RegLoc, StartLoc) &&
20912092 X86MCRegisterClasses[X86::VK1RegClassID].contains(RegNo)) {
2093 if (RegNo == X86::K0)
2094 return Error(RegLoc, "Register k0 can't be used as write mask");
20922095 if (!getLexer().is(AsmToken::RCurly))
20932096 return Error(getLexer().getLoc(), "Expected } at this point");
20942097 Operands.push_back(X86Operand::CreateToken("{", StartLoc));
None // RUN: not llvm-mc -triple x86_64-unknown-unknown -mcpu=knl -mattr=+avx512dq -mattr=+avx512f --show-encoding %s 2> %t.err
1 // RUN: FileCheck --check-prefix=ERR < %t.err %s
0 // RUN: not llvm-mc %s -triple x86_64-unknown-unknown -mcpu=knl -mattr=+avx512dq -mattr=+avx512f --show-encoding -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
21
3 // ERR: invalid operand for instruction
2 // ERR: Register k0 can't be used as write mask
43 vpcmpd $1, %zmm24, %zmm7, %k5{%k0}
54
65 // ERR: Expected a {z} mark at this point
66 // CHECK: error: Expected a {z} mark at this point
77 vfmsub213ps zmm8{rn-sae}, zmm8, zmm8
88 // CHECK: error: Expected an op-mask register at this point
9 vpcmpltd k5{k0}, zmm7, zmm24
10 // CHECK: error: Register k0 can't be used as write mask
11