summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-10-30 03:12:45 -0700
committerJin Kyu Song <jin.kyu.song@intel.com>2013-11-20 11:29:42 -0800
commit25c221258641aec4198e9e46127536676878a4bd (patch)
tree3b3435793bd08c7bcbde3dba5b8a6d581ad05863 /parser.c
parent7903c07b7753fb02fc3b5ba6211dc566bc25aa7c (diff)
downloadnasm-25c221258641aec4198e9e46127536676878a4bd.tar.gz
nasm-25c221258641aec4198e9e46127536676878a4bd.tar.bz2
nasm-25c221258641aec4198e9e46127536676878a4bd.zip
match: Check the number of elements in broadcasting operands
The broadcasting decorator {1to##} must describe exactly how many times the memory element is repeated in order to clearly match the correct instruction format. For example, vaddpd zmm30,zmm29,QWORD [rdx+0x3f8]{1to8} ; good vaddpd zmm30,zmm29,QWORD [rdx+0x3f8]{1to16} ; fail qword * 16 = 1024b vaddps zmm30,zmm29,DWORD [rcx]{1to16} ; good vaddps zmm30,zmm29,DWORD [rcx]{1to8} ; fail dword * 8 = 256b Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 155308f..343f35e 100644
--- a/parser.c
+++ b/parser.c
@@ -947,7 +947,8 @@ is_expression:
* 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]);