case P_REPNZ:
case P_XACQUIRE:
case P_XRELEASE:
+ case P_BND:
+ case P_NOBND:
return PPS_REP;
case P_O16:
case P_O32:
case P_A64:
case P_ASP:
return PPS_ASIZE;
+ case P_EVEX:
+ case P_VEX3:
+ case P_VEX2:
+ return PPS_VEX;
default:
nasm_error(ERR_PANIC, "Invalid value %d passed to prefix_slot()", prefix);
return -1;
* when two or more decorators follow a register operand,
* consecutive decorators are parsed here.
* opmask and zeroing decorators can be placed in any order.
- * e.g. zmm1 {k2}{z} or zmm2 {z,k3}
+ * e.g. zmm1 {k2}{z} or zmm2 {z}{k3}
* decorator(s) are placed at the end of an operand.
*/
static bool parse_braces(decoflags_t *decoflags)
do {
if (i == TOKEN_OPMASK) {
if (*decoflags & OPMASK_MASK) {
- nasm_error(ERR_NONFATAL, "opmask k%lu is already set",
+ nasm_error(ERR_NONFATAL, "opmask k%"PRIu64" is already set",
*decoflags & OPMASK_MASK);
*decoflags &= ~OPMASK_MASK;
}
process_size_override(result, op);
i = stdscan(NULL, &tokval);
}
+ /* when a comma follows an opening bracket - [ , eax*4] */
+ if (i == ',') {
+ /* treat as if there is a zero displacement virtually */
+ tokval.t_type = TOKEN_NUM;
+ tokval.t_integer = 0;
+ stdscan_set(stdscan_get() - 1); /* rewind the comma */
+ }
} else { /* immediate operand, or register */
mref = false;
bracket = false; /* placate optimisers */
* is expected for memory reference operands
*/
if (tokval.t_flag & TFLAG_BRDCAST) {
- brace_flags |= GEN_BRDCAST(0);
+ brace_flags |= GEN_BRDCAST(0) |
+ VAL_BRNUM(tokval.t_integer - BRC_1TO8);
i = stdscan(NULL, &tokval);
} else if (i == TOKEN_OPMASK) {
brace_flags |= VAL_OPMASK(nasm_regvals[tokval.t_integer]);