0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

BR 3392370: {z} decorator allowed on MOVDQ* memory operands

The spec says very clearly the {z} decorator is allowed on memory
operands for the MOVDQ* instructions.  Remove special cases from the
code to disallow this case, which had the unfortunate effect of
generating a very uninformative error message.

Reported-by: Agner <agner@agner.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin
2017-03-31 14:37:24 -07:00
parent 2cd8bab66a
commit c33d95fde9
2 changed files with 22 additions and 54 deletions

View File

@@ -975,25 +975,11 @@ is_expression:
recover = true;
} else { /* we got the required ] */
i = stdscan(NULL, &tokval);
if ((i == TOKEN_DECORATOR) || (i == TOKEN_OPMASK)) {
/*
* 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) |
VAL_BRNUM(tokval.t_integer - BRC_1TO2);
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 or opmask "
"decorator expected inside braces");
recover = true;
}
if (i == TOKEN_DECORATOR || i == TOKEN_OPMASK) {
/* parse opmask (and zeroing) after an operand */
recover = parse_braces(&brace_flags);
i = tokval.t_type;
}
if (i != 0 && i != ',') {
nasm_error(ERR_NONFATAL, "comma or end of line expected");
recover = true;