Skip to content

Commit

Permalink
Implement RDRSEED, ADX and PRFCHW instructions
Browse files Browse the repository at this point in the history
gas/

	* config/tc-i386.c: Add ADX, RDSEED and PRFCHW asm directives.
	* doc/c-i386.texi: Document the new directives.

gas/testsuite/

	* gas/i386/i386.exp: Run adx, rdseed and prefetchw tests.
	* gas/i386/x86-64-arch-2.s: Use prefetchw as 3dnow and Prfchw tests.
	* gas/i386/arch-10.s: Likewise.
	* gas/i386/arch-10-1.l: Changed correspondingly.
	* gas/i386/arch-10-2.l: Likewise.
	* gas/i386/arch-10-3.l: Likewise.
	* gas/i386/arch-10-4.l: Likewise.
	* gas/i386/arch-10.d: Likewise.
	* gas/i386/arch-10-lzcnt.d: Likewise.
	* gas/i386/x86-64-arch-2.d: Likewise.
	* gas/i386/x86-64-arch-2-lzcnt.d: Likewise.
	* gas/i386/ilp32/x86-64-arch-2.d: Likewise.
	* gas/i386/arch-10-prefetchw.d: New file.
	* gas/i386/x86-64-arch-2-prefetchw.d: Likewise.
	* gas/i386/rdseed.s: Likewise.
	* gas/i386/rdseed.d: Likewise.
	* gas/i386/rdseed-intel.d: Likewise.
	* gas/i386/adx.s: Likewise.
	* gas/i386/adx.d: Likewise.
	* gas/i386/adx-intel.d: Likewise.
	* gas/i386/x86-64-rdseed.s: Likewise.
	* gas/i386/x86-64-rdseed.d: Likewise.
	* gas/i386/x86-64-rdseed-intel.d: Likewise.
	* gas/i386/x86-64-adx.s: Likewise.
	* gas/i386/x86-64-adx.d: Likewise.
	* gas/i386/x86-64-adx-intel.d: Likewise.

opcodes/

	* i386-dis.c (PREFIX_0F38F6): New.
	(prefix_table): Add adcx, adox instructions.
	(three_byte_table): Use PREFIX_0F38F6.
	(mod_table): Add rdseed instruction.
	* i386-gen.c (cpu_flag_init): Add CpuADX, CpuRDSEED, CpuPRFCHW.
	(cpu_flags): Likewise.
	* i386-opc.h: Add CpuADX, CpuRDSEED, CpuPRFCHW.
	(i386_cpu_flags): Add fields cpurdseed, cpuadx, cpuprfchw.
	* i386-opc.tbl: Add instrcutions adcx, adox, rdseed. Extend
	prefetchw.
	* i386-tbl.h: Regenerate.
	* i386-init.h: Likewise.
  • Loading branch information
hjl-tools committed Jul 16, 2012
1 parent 2aecfcf commit da79849
Show file tree
Hide file tree
Showing 7 changed files with 5,611 additions and 2,754 deletions.
15 changes: 15 additions & 0 deletions opcodes/ChangeLog
@@ -1,3 +1,18 @@
2012-07-16 Michael Zolotukhin <michael.v.zolotukhin@intel.com>

* i386-dis.c (PREFIX_0F38F6): New.
(prefix_table): Add adcx, adox instructions.
(three_byte_table): Use PREFIX_0F38F6.
(mod_table): Add rdseed instruction.
* i386-gen.c (cpu_flag_init): Add CpuADX, CpuRDSEED, CpuPRFCHW.
(cpu_flags): Likewise.
* i386-opc.h: Add CpuADX, CpuRDSEED, CpuPRFCHW.
(i386_cpu_flags): Add fields cpurdseed, cpuadx, cpuprfchw.
* i386-opc.tbl: Add instrcutions adcx, adox, rdseed. Extend
prefetchw.
* i386-tbl.h: Regenerate.
* i386-init.h: Likewise.

2012-07-05 Thomas Schwinge <thomas@codesourcery.com>

* mips-dis.c: Remove gratuitous newline.
Expand Down
12 changes: 11 additions & 1 deletion opcodes/i386-dis.c
Expand Up @@ -851,6 +851,7 @@ enum
PREFIX_0F38DF,
PREFIX_0F38F0,
PREFIX_0F38F1,
PREFIX_0F38F6,
PREFIX_0F3A08,
PREFIX_0F3A09,
PREFIX_0F3A0A,
Expand Down Expand Up @@ -3485,6 +3486,14 @@ static const struct dis386 prefix_table[][4] = {
{ "crc32", { Gdq, { CRC32_Fixup, v_mode } } },
},

/* PREFIX_0F38F6 */
{
{ Bad_Opcode },
{ "adoxS", { Gdq, Edq} },
{ "adcxS", { Gdq, Edq} },
{ Bad_Opcode },
},

/* PREFIX_0F3A08 */
{
{ Bad_Opcode },
Expand Down Expand Up @@ -6055,7 +6064,7 @@ static const struct dis386 three_byte_table[][256] = {
{ Bad_Opcode },
{ Bad_Opcode },
{ Bad_Opcode },
{ Bad_Opcode },
{ PREFIX_TABLE (PREFIX_0F38F6) },
{ Bad_Opcode },
/* f8 */
{ Bad_Opcode },
Expand Down Expand Up @@ -10323,6 +10332,7 @@ static const struct dis386 mod_table[][2] = {
{
/* MOD_0FC7_REG_7 */
{ "vmptrst", { Mq } },
{ "rdseed", { Ev } },
},
{
/* MOD_0FD7 */
Expand Down
9 changes: 9 additions & 0 deletions opcodes/i386-gen.c
Expand Up @@ -192,6 +192,12 @@ static initializer cpu_flag_init[] =
"unknown" },
{ "CPU_K1OM_FLAGS",
"unknown" },
{ "CPU_ADX_FLAGS",
"CpuADX" },
{ "CPU_RDSEED_FLAGS",
"CpuRdSeed" },
{ "CPU_PRFCHW_FLAGS",
"CpuPRFCHW" },
};

static initializer operand_type_init[] =
Expand Down Expand Up @@ -359,6 +365,9 @@ static bitfield cpu_flags[] =
BITFIELD (CpuRTM),
BITFIELD (CpuINVPCID),
BITFIELD (CpuVMFUNC),
BITFIELD (CpuRDSEED),
BITFIELD (CpuADX),
BITFIELD (CpuPRFCHW),
BITFIELD (Cpu64),
BITFIELD (CpuNo64),
#ifdef CpuUnused
Expand Down

0 comments on commit da79849

Please sign in to comment.