* gas/config/tc-i386.c (output_insn): Handle PadLock instructions.
* gas/config/tc-i386.h (CpuPadLock): New define.
(CpuUnknownFlags): Added CpuPadLock.
* include/opcode/i386.h (i386_optab): Added xstore/xcrypt insns.
* opcodes/i386-dis.c (PADLOCK_SPECIAL, PADLOCK_0): New defines.
(dis386_twobyte): Opcode 0xa7 is PADLOCK_0.
(padlock_table): New struct with PadLock instructions.
(print_insn): Handle PADLOCK_SPECIAL.
+2004-03-12 Michal Ludvig <mludvig@suse.cz>
+
+ * config/tc-i386.c (output_insn): Handle PadLock instructions.
+ * config/tc-i386.h (CpuPadLock): New define.
+ (CpuUnknownFlags): Added CpuPadLock.
+
2004-03-07 Andreas Schwab <schwab@suse.de>
* doc/c-hppa.texi (HPPA Directives): Fix typo.
/* i386.c -- Assemble code for the Intel 80386
Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
/* Intel 80386 machine specific gas.
Written by Eliot Dresselhaus (eliot@mgm.mit.edu).
x86_64 support by Jan Hubicka (jh@suse.cz)
+ VIA PadLock support by Michal Ludvig (mludvig@suse.cz)
Bugs & suggestions are completely welcome. This is free software.
Please help us make it better. */
md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
}
-
static void
output_insn ()
{
char *p;
unsigned char *q;
- /* All opcodes on i386 have either 1 or 2 bytes. We may use third
- byte for the SSE instructions to specify a prefix they require. */
- if (i.tm.base_opcode & 0xff0000)
- add_prefix ((i.tm.base_opcode >> 16) & 0xff);
+ /* All opcodes on i386 have either 1 or 2 bytes, PadLock instructions
+ have 3 bytes. We may use one more higher byte to specify a prefix
+ the instruction requires. */
+ if ((i.tm.cpu_flags & CpuPadLock) != 0
+ && (i.tm.base_opcode & 0xff000000) != 0)
+ {
+ unsigned int prefix;
+ prefix = (i.tm.base_opcode >> 24) & 0xff;
+
+ if (prefix != REPE_PREFIX_OPCODE
+ || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE)
+ add_prefix (prefix);
+ }
+ else
+ if ((i.tm.cpu_flags & CpuPadLock) == 0
+ && (i.tm.base_opcode & 0xff0000) != 0)
+ add_prefix ((i.tm.base_opcode >> 16) & 0xff);
/* The prefix bytes. */
for (q = i.prefix;
}
else
{
- p = frag_more (2);
+ if ((i.tm.cpu_flags & CpuPadLock) != 0)
+ {
+ p = frag_more (3);
+ *p++ = (i.tm.base_opcode >> 16) & 0xff;
+ }
+ else
+ p = frag_more (2);
+
/* Put out high byte first: can't use md_number_to_chars! */
*p++ = (i.tm.base_opcode >> 8) & 0xff;
*p = i.tm.base_opcode & 0xff;
/* tc-i386.h -- Header file for tc-i386.c
Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003
+ 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#define CpuSSE2 0x2000 /* Streaming SIMD extensions 2 required */
#define Cpu3dnow 0x4000 /* 3dnow! support required */
#define CpuPNI 0x8000 /* Prescott New Instructions required */
+#define CpuPadLock 0x10000 /* VIA PadLock required */
/* These flags are set by gas depending on the flag_code. */
#define Cpu64 0x4000000 /* 64bit support required */
#define CpuNo64 0x8000000 /* Not supported in the 64bit mode */
/* The default value for unknown CPUs - enable all features to avoid problems. */
-#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|CpuK6|CpuAthlon)
+#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|CpuK6|CpuAthlon|CpuPadLock)
/* the bits in opcode_modifier are used to generate the final opcode from
the base_opcode. These bits also are used to detect alternate forms of
+2004-03-12 Michal Ludvig <mludvig@suse.cz>
+
+ * i386.h (i386_optab): Added xstore/xcrypt insns.
+
2004-02-09 Anil Paranjpe <anilp1@KPITCummins.com>
* h8300.h (32bit ldc/stc): Add relaxing support.
{"sysret", 0, 0x0f07, X, CpuK6, lq_Suf|DefaultSize, { 0, 0, 0} },
{"swapgs", 0, 0x0f01, 0xf8, Cpu64, NoSuf|ImmExt, { 0, 0, 0} },
+/* VIA PadLock extensions. */
+{"xstorerng", 0, 0x0fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} },
+{"xcryptecb", 0, 0xf30fa7c8, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} },
+{"xcryptcbc", 0, 0xf30fa7d0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} },
+{"xcryptcfb", 0, 0xf30fa7e0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} },
+{"xcryptofb", 0, 0xf30fa7e8, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} },
+
/* sentinel */
{NULL, 0, 0, 0, 0, 0, { 0, 0, 0} }
};
+2004-03-12 Michal Ludvig <mludvig@suse.cz>
+
+ * i386-dis.c (PADLOCK_SPECIAL, PADLOCK_0): New defines.
+ (dis386_twobyte): Opcode 0xa7 is PADLOCK_0.
+ (padlock_table): New struct with PadLock instructions.
+ (print_insn): Handle PADLOCK_SPECIAL.
+
2004-03-12 Alan Modra <amodra@bigpond.net.au>
* i386-dis.c (grps): Use clflush by default for 0x0fae/7.
/* Print i386 instructions for GDB, the GNU debugger.
Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GDB.
* July 1988
* modified by John Hassey (hassey@dg-rtp.dg.com)
* x86-64 support added by Jan Hubicka (jh@suse.cz)
+ * VIA PadLock support by Michal Ludvig (mludvig@suse.cz)
*/
/*
#define USE_GROUPS 2
#define USE_PREFIX_USER_TABLE 3
#define X86_64_SPECIAL 4
+#define PADLOCK_SPECIAL 5
#define FLOAT NULL, NULL, FLOATCODE, NULL, 0, NULL, 0
#define GRP13 NULL, NULL, USE_GROUPS, NULL, 20, NULL, 0
#define GRP14 NULL, NULL, USE_GROUPS, NULL, 21, NULL, 0
#define GRPAMD NULL, NULL, USE_GROUPS, NULL, 22, NULL, 0
+#define GRPPLOCK NULL, NULL, USE_GROUPS, NULL, 23, NULL, 0
#define PREGRP0 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 0, NULL, 0
#define PREGRP1 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 1, NULL, 0
#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 0
+#define PADLOCK_0 NULL, NULL, PADLOCK_SPECIAL, NULL, 0, NULL, 0
+
typedef void (*op_rtn) (int bytemode, int sizeflag);
struct dis386 {
{ "shldS", Ev, Gv, Ib },
{ "shldS", Ev, Gv, CL },
{ "(bad)", XX, XX, XX },
- { "(bad)", XX, XX, XX },
+ { PADLOCK_0 },
/* a8 */
{ "pushT", gs, XX, XX },
{ "popT", gs, XX, XX },
{ "(bad)", XX, XX, XX },
{ "(bad)", XX, XX, XX },
{ "(bad)", XX, XX, XX },
+ },
+ /* GRPPLOCK */
+ {
+ { "xstore", XX, XX, XX },
+ { "xcryptecb", XX, XX, XX },
+ { "xcryptcbc", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
+ { "xcryptcfb", XX, XX, XX },
+ { "xcryptofb", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
}
};
},
};
+static const struct dis386 padlock_table[][8] = {
+ {
+ { "xstorerng", XX, XX, XX },
+ { "xcryptecb", XX, XX, XX },
+ { "xcryptcbc", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
+ { "xcryptcfb", XX, XX, XX },
+ { "xcryptofb", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
+ { "(bad)", XX, XX, XX },
+ },
+};
+
#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
static void
dp = &x86_64_table[dp->bytemode2][mode_64bit];
break;
+ case PADLOCK_SPECIAL:
+ FETCH_DATA (info, codep + 1);
+ index = (*codep++ >> 3) & 0x07;
+ dp = &padlock_table[dp->bytemode2][index];
+ break;
+
default:
oappend (INTERNAL_DISASSEMBLER_ERROR);
break;