[llvm] r310789 - [X86][AsmParser][AVX512] Error appropriately when K0 is tried as a write-mask
Coby Tayree via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 05:03:00 PDT 2017
Author: coby
Date: Sun Aug 13 05:03:00 2017
New Revision: 310789
URL: http://llvm.org/viewvc/llvm-project?rev=310789&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
llvm/trunk/test/MC/X86/avx512-err.s
llvm/trunk/test/MC/X86/intel-syntax-avx512-error.s
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=310789&r1=310788&r2=310789&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Sun Aug 13 05:03:00 2017
@@ -2088,8 +2088,11 @@ bool X86AsmParser::HandleAVX512Operand(O
// Parse an op-mask register mark ({%k<NUM>}), which is now to be
// expected
unsigned RegNo;
- if (!ParseRegister(RegNo, StartLoc, StartLoc) &&
+ SMLoc RegLoc;
+ if (!ParseRegister(RegNo, RegLoc, StartLoc) &&
X86MCRegisterClasses[X86::VK1RegClassID].contains(RegNo)) {
+ if (RegNo == X86::K0)
+ return Error(RegLoc, "Register k0 can't be used as write mask");
if (!getLexer().is(AsmToken::RCurly))
return Error(getLexer().getLoc(), "Expected } at this point");
Operands.push_back(X86Operand::CreateToken("{", StartLoc));
Modified: llvm/trunk/test/MC/X86/avx512-err.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/avx512-err.s?rev=310789&r1=310788&r2=310789&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/avx512-err.s (original)
+++ llvm/trunk/test/MC/X86/avx512-err.s Sun Aug 13 05:03:00 2017
@@ -1,7 +1,6 @@
-// RUN: not llvm-mc -triple x86_64-unknown-unknown -mcpu=knl -mattr=+avx512dq -mattr=+avx512f --show-encoding %s 2> %t.err
-// RUN: FileCheck --check-prefix=ERR < %t.err %s
+// 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
-// ERR: invalid operand for instruction
+// ERR: Register k0 can't be used as write mask
vpcmpd $1, %zmm24, %zmm7, %k5{%k0}
// ERR: Expected a {z} mark at this point
Modified: llvm/trunk/test/MC/X86/intel-syntax-avx512-error.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/intel-syntax-avx512-error.s?rev=310789&r1=310788&r2=310789&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/intel-syntax-avx512-error.s (original)
+++ llvm/trunk/test/MC/X86/intel-syntax-avx512-error.s Sun Aug 13 05:03:00 2017
@@ -7,3 +7,6 @@
// CHECK: error: Expected a {z} mark at this point
vfmsub213ps zmm8{rn-sae}, zmm8, zmm8
// CHECK: error: Expected an op-mask register at this point
+ vpcmpltd k5{k0}, zmm7, zmm24
+// CHECK: error: Register k0 can't be used as write mask
+
More information about the llvm-commits
mailing list