summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-03 09:31:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-03 09:31:20 +0000
commitd3a1985074ad4e3231e41b6646aed22aa461c085 (patch)
tree1ddcb5bdcee6891ba51057b88cfee0962857cc82 /gnu
parent7209e158722a1ef701d0fe334ce5555b844fbcf2 (diff)
grok VIA C3 xmove-* and xcrypt-* instructions; niklas ok
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/opcodes/i386-dis.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils/opcodes/i386-dis.c b/gnu/usr.bin/binutils/opcodes/i386-dis.c
index 5621d8afadf..54e49b57078 100644
--- a/gnu/usr.bin/binutils/opcodes/i386-dis.c
+++ b/gnu/usr.bin/binutils/opcodes/i386-dis.c
@@ -248,6 +248,7 @@ fetch_data (info, addr)
#define XS OP_XS, v_mode
#define None OP_E, 0
#define OPSUF OP_3DNowSuffix, 0
+#define OPXCRYPT OP_xcrypt, 0
#define OPSIMD OP_SIMD_Suffix, 0
#define cond_jump_flag NULL, cond_jump_mode
@@ -292,6 +293,7 @@ static void OP_EX PARAMS ((int, int));
static void OP_MS PARAMS ((int, int));
static void OP_XS PARAMS ((int, int));
static void OP_3DNowSuffix PARAMS ((int, int));
+static void OP_xcrypt PARAMS ((int, int));
static void OP_SIMD_Suffix PARAMS ((int, int));
static void SIMD_Fixup PARAMS ((int, int));
@@ -1812,7 +1814,7 @@ static const struct dis386 dis386_twobyte_att[] = {
{ "shldS", Ev, Gv, Ib },
{ "shldS", Ev, Gv, CL },
{ "(bad)", XX, XX, XX },
- { "(bad)", XX, XX, XX },
+ { "", OPXCRYPT, XX, XX },
/* a8 */
{ "pushI", gs, XX, XX },
{ "popI", gs, XX, XX },
@@ -2104,7 +2106,7 @@ static const struct dis386 dis386_twobyte_intel[] = {
{ "shld", Ev, Gv, Ib },
{ "shld", Ev, Gv, CL },
{ "(bad)", XX, XX, XX },
- { "(bad)", XX, XX, XX },
+ { "", OPXCRYPT, XX, XX },
/* a8 */
{ "push", gs, XX, XX },
{ "pop", gs, XX, XX },
@@ -5037,6 +5039,17 @@ OP_XS (bytemode, sizeflag)
BadOp();
}
+static struct {
+ unsigned char opc;
+ char *name;
+} xcrypt[] = {
+ { 0xc0, "xstore-rng" },
+ { 0xc8, "xcrypt-ecb" },
+ { 0xd0, "xcrypt-cbc" },
+ { 0xe0, "xcrypt-cfb" },
+ { 0xe8, "xcrypt-ofb" },
+};
+
static const char *Suffix3DNow[] = {
/* 00 */ NULL, NULL, NULL, NULL,
/* 04 */ NULL, NULL, NULL, NULL,
@@ -5131,6 +5144,29 @@ OP_3DNowSuffix (bytemode, sizeflag)
}
}
+static void
+OP_xcrypt (bytemode, sizeflag)
+ int bytemode ATTRIBUTE_UNUSED;
+ int sizeflag ATTRIBUTE_UNUSED;
+{
+ const char *mnemonic = NULL;
+ unsigned int i;
+
+ FETCH_DATA (the_info, codep + 1);
+ /* VIA C3 xcrypt-* & xmove-* instructions are specified by an opcode
+ suffix in the place where an 8-bit immediate would normally go.
+ ie. the last byte of the instruction. */
+ obufp = obuf + strlen(obuf);
+
+ for (i = 0; i < sizeof(xcrypt) / sizeof(xcrypt[0]); i++)
+ if (xcrypt[i].opc == (*codep & 0xff))
+ mnemonic = xcrypt[i].name;
+ codep++;
+ if (mnemonic)
+ oappend (mnemonic);
+ else
+ BadOp();
+}
static const char *simd_cmp_op [] = {
"eq",