diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-05-07 09:30:02 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-05-07 16:57:48 -0700 |
commit | c0a30a9f0ab48fd7cb0fed0cd6710fe478650a7f (patch) | |
tree | 4470e20fd5dfa2c27754a28f175ce66a962a735e /gas/config | |
parent | 75c0a438994f00240ecd1baca3e3c11cc3b219e5 (diff) | |
download | gdb-c0a30a9f0ab48fd7cb0fed0cd6710fe478650a7f.zip gdb-c0a30a9f0ab48fd7cb0fed0cd6710fe478650a7f.tar.gz gdb-c0a30a9f0ab48fd7cb0fed0cd6710fe478650a7f.tar.bz2 |
Enable Intel MOVDIRI, MOVDIR64B instructions
gas/
* config/tc-i386.c (cpu_arch): Add .movdir, .movdir64b.
(cpu_noarch): Likewise.
(process_suffix): Add check for register size.
* doc/c-i386.texi: Document movdiri, movdir64b.
* testsuite/gas/i386/i386.exp: Run MOVDIR{I,64B} tests.
* testsuite/gas/i386/movdir-intel.d: New file.
* testsuite/gas/i386/movdir.d: Likewise.
* testsuite/gas/i386/movdir.s: Likewise.
* testsuite/gas/i386/movdir64b-reg.s: Likewise.
* testsuite/gas/i386/movdir64b-reg.l: Likewise.
* testsuite/gas/i386/x86-64-movdir-intel.d: Likewise.
* testsuite/gas/i386/x86-64-movdir.d: Likewise.
* testsuite/gas/i386/x86-64-movdir.s: Likewise.
* testsuite/gas/i386/x86-64-movdir64b-reg.s: Likewise.
* testsuite/gas/i386/x86-64-movdir64b-reg.l: Likewise.
opcodes/
* i386-dis.c (Gva): New.
(enum): Add PREFIX_0F38F8, PREFIX_0F38F9,
MOD_0F38F8_PREFIX_2, MOD_0F38F9_PREFIX_0.
(prefix_table): New instructions (see prefix above).
(mod_table): New instructions (see prefix above).
(OP_G): Handle va_mode.
* i386-gen.c (cpu_flag_init): Add CPU_MOVDIRI_FLAGS,
CPU_MOVDIR64B_FLAGS.
(cpu_flags): Add CpuMOVDIRI and CpuMOVDIR64B.
* i386-opc.h (enum): Add CpuMOVDIRI, CpuMOVDIR64B.
(i386_cpu_flags): Add cpumovdiri and cpumovdir64b.
* i386-opc.tbl: Add movidir{i,64b}.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index b4c93a2..be31d9e 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1029,6 +1029,10 @@ static const arch_entry cpu_arch[] = CPU_WAITPKG_FLAGS, 0 }, { STRING_COMMA_LEN (".cldemote"), PROCESSOR_UNKNOWN, CPU_CLDEMOTE_FLAGS, 0 }, + { STRING_COMMA_LEN (".movdiri"), PROCESSOR_UNKNOWN, + CPU_MOVDIRI_FLAGS, 0 }, + { STRING_COMMA_LEN (".movdir64b"), PROCESSOR_UNKNOWN, + CPU_MOVDIR64B_FLAGS, 0 }, }; static const noarch_entry cpu_noarch[] = @@ -1064,6 +1068,8 @@ static const noarch_entry cpu_noarch[] = { STRING_COMMA_LEN ("noavx512_bitalg"), CPU_ANY_AVX512_BITALG_FLAGS }, { STRING_COMMA_LEN ("noibt"), CPU_ANY_IBT_FLAGS }, { STRING_COMMA_LEN ("noshstk"), CPU_ANY_SHSTK_FLAGS }, + { STRING_COMMA_LEN ("nomovdiri"), CPU_ANY_MOVDIRI_FLAGS }, + { STRING_COMMA_LEN ("nomovdir64b"), CPU_ANY_MOVDIR64B_FLAGS }, }; #ifdef I386COFF @@ -6044,6 +6050,41 @@ process_suffix (void) break; } + if (i.reg_operands != 0 + && i.operands > 1 + && i.tm.opcode_modifier.addrprefixopreg + && !i.tm.opcode_modifier.immext) + { + /* Check invalid register operand when the address size override + prefix changes the size of register operands. */ + unsigned int op; + enum { need_word, need_dword, need_qword } need; + + if (flag_code == CODE_32BIT) + need = i.prefix[ADDR_PREFIX] ? need_word : need_dword; + else + { + if (i.prefix[ADDR_PREFIX]) + need = need_dword; + else + need = flag_code == CODE_64BIT ? need_qword : need_word; + } + + for (op = 0; op < i.operands; op++) + if (i.types[op].bitfield.reg + && ((need == need_word + && !i.op[op].regs->reg_type.bitfield.word) + || (need == need_dword + && !i.op[op].regs->reg_type.bitfield.dword) + || (need == need_qword + && !i.op[op].regs->reg_type.bitfield.qword))) + { + as_bad (_("invalid register operand size for `%s'"), + i.tm.name); + return 0; + } + } + return 1; } |