diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2008-01-02 21:43:34 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2008-01-02 21:43:34 +0000 |
commit | 582d5eddfe4a3e1d644c473f30a1c1e85c665743 (patch) | |
tree | 392e6091dd2db1de46a080a8ec797ddc82e07aff /gas/config | |
parent | 6c7ac64e1764d0feff5d87ee849652d69f4381ae (diff) | |
download | binutils-582d5eddfe4a3e1d644c473f30a1c1e85c665743.zip binutils-582d5eddfe4a3e1d644c473f30a1c1e85c665743.tar.gz binutils-582d5eddfe4a3e1d644c473f30a1c1e85c665743.tar.bz2 |
gas/
2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
PR gas/5534
* config/tc-i386.c (match_template): Handle XMMWORD_MNEM_SUFFIX.
Check memory size in Intel mode.
(process_suffix): Handle XMMWORD_MNEM_SUFFIX.
(intel_e09): Likewise.
* config/tc-i386.h (XMMWORD_MNEM_SUFFIX): New.
gas/testsuite/
2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
PR gas/5534
* gas/i386/intel.s: Use QWORD on movq instead of DWORD.
* gas/i386/inval.s: Add tests for movq.
* gas/i386/x86-64-inval.s: Likewise.
* gas/i386/inval.l: Updated.
* gas/i386/x86-64-inval.l: Likewise.
opcodes/
2008-01-02 H.J. Lu <hongjiu.lu@intel.com>
PR gas/5534
* i386-gen.c (opcode_modifiers): Add No_xSuf, CheckSize,
Byte, Word, Dword, QWord and Xmmword.
* i386-opc.h (No_xSuf): New.
(CheckSize): Likewise.
(Byte): Likewise.
(Word): Likewise.
(Dword): Likewise.
(QWord): Likewise.
(Xmmword): Likewise.
(FWait): Updated.
(i386_opcode_modifier): Add No_xSuf, CheckSize, Byte, Word,
Dword, QWord and Xmmword.
* i386-opc.tbl: Add CheckSize|QWord to movq if IgnoreSize is
used.
* i386-tbl.h: Regenerated.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 26 | ||||
-rw-r--r-- | gas/config/tc-i386.h | 4 |
2 files changed, 26 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7bf7661..18e0bb7 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3047,6 +3047,8 @@ match_template (void) suffix_check.no_qsuf = 1; else if (i.suffix == LONG_DOUBLE_MNEM_SUFFIX) suffix_check.no_ldsuf = 1; + else if (i.suffix == XMMWORD_MNEM_SUFFIX) + suffix_check.no_xsuf = 1; for (t = current_templates->start; t < current_templates->end; t++) { @@ -3077,6 +3079,18 @@ match_template (void) || (t->opcode_modifier.no_ldsuf && suffix_check.no_ldsuf))) continue; + /* Check the memory size in Intel mode when it is provided if + needed. */ + if (intel_syntax + && i.suffix + && t->opcode_modifier.checksize + && (!t->opcode_modifier.byte || !suffix_check.no_bsuf) + && (!t->opcode_modifier.word || !suffix_check.no_wsuf) + && (!t->opcode_modifier.dword || !suffix_check.no_lsuf) + && (!t->opcode_modifier.qword || !suffix_check.no_qsuf) + && (!t->opcode_modifier.xmmword || !suffix_check.no_xsuf)) + continue; + for (j = 0; j < MAX_OPERANDS; j++) operand_types [j] = t->operand_types [j]; @@ -3453,6 +3467,11 @@ process_suffix (void) if (!check_word_reg ()) return 0; } + else if (i.suffix == XMMWORD_MNEM_SUFFIX) + { + /* Skip if the instruction has x suffix. match_template + should check if it is a valid suffix. */ + } else if (intel_syntax && i.tm.opcode_modifier.ignoresize) /* Do nothing if the instruction is going to ignore the prefix. */ ; @@ -3535,7 +3554,9 @@ process_suffix (void) /* Change the opcode based on the operand size given by i.suffix; We don't need to change things for byte insns. */ - if (i.suffix && i.suffix != BYTE_MNEM_SUFFIX) + if (i.suffix + && i.suffix != BYTE_MNEM_SUFFIX + && i.suffix != XMMWORD_MNEM_SUFFIX) { /* It's not a byte, select word/dword operation. */ if (i.tm.opcode_modifier.w) @@ -8166,8 +8187,7 @@ intel_e09 (void) else if (prev_token.code == T_XMMWORD) { - /* XXX ignored for now, but accepted since gcc uses it */ - suffix = 0; + suffix = XMMWORD_MNEM_SUFFIX; } else diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index bf27842..2feee31 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -116,12 +116,14 @@ extern const char *i386_comment_chars; #define IMMEDIATE_PREFIX '$' #define ABSOLUTE_PREFIX '*' -/* these are the instruction mnemonic suffixes. */ +/* these are the instruction mnemonic suffixes in AT&T syntax or + memory operand size in Intel syntax. */ #define WORD_MNEM_SUFFIX 'w' #define BYTE_MNEM_SUFFIX 'b' #define SHORT_MNEM_SUFFIX 's' #define LONG_MNEM_SUFFIX 'l' #define QWORD_MNEM_SUFFIX 'q' +#define XMMWORD_MNEM_SUFFIX 'x' /* Intel Syntax. Use a non-ascii letter since since it never appears in instructions. */ #define LONG_DOUBLE_MNEM_SUFFIX '\1' |