summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-08-21 19:29:12 -0700
committerCyrill Gorcunov <gorcunov@gmail.com>2013-08-22 19:37:49 +0400
commit50ab1522e95b508c0c61ac000aaece8469088b5b (patch)
treede248d6275cc558f1d67777edfb85431db8b461d /parser.c
parentd4760c19b55ad7cda97c66e5caa29b405fa539a4 (diff)
downloadnasm-50ab1522e95b508c0c61ac000aaece8469088b5b.tar.gz
nasm-50ab1522e95b508c0c61ac000aaece8469088b5b.tar.bz2
nasm-50ab1522e95b508c0c61ac000aaece8469088b5b.zip
AVX-512: Fix parser to handle opmask decorator correctly
When a memory reference operand is a destination, this could have an opmask decorator as well. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/parser.c b/parser.c
index ccbce49..585abe2 100644
--- a/parser.c
+++ b/parser.c
@@ -758,17 +758,20 @@ is_expression:
recover = true;
} else { /* we got the required ] */
i = stdscan(NULL, &tokval);
- if (i == TOKEN_DECORATOR) {
+ if ((i == TOKEN_DECORATOR) || (i == TOKEN_OPMASK)) {
/*
- * according to AVX512 spec, only broacast decorator is
- * expected for memory reference operands
+ * according to AVX512 spec, broacast or opmask decorator
+ * is expected for memory reference operands
*/
if (tokval.t_flag & TFLAG_BRDCAST) {
brace_flags |= GEN_BRDCAST(0);
i = stdscan(NULL, &tokval);
+ } else if (i == TOKEN_OPMASK) {
+ brace_flags |= VAL_OPMASK(nasm_regvals[tokval.t_integer]);
+ i = stdscan(NULL, &tokval);
} else {
- nasm_error(ERR_NONFATAL, "broadcast decorator"
- "expected inside braces");
+ nasm_error(ERR_NONFATAL, "broadcast or opmask "
+ "decorator expected inside braces");
recover = true;
}
}