summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-16 18:20:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-16 18:20:56 +0000
commit672757b3b3a9e6847d5ef837a47d068c367bbc91 (patch)
treea968092b51e6bd582d7665ce7cbafa42f8d76271 /gnu/usr.bin
parent0e39eba453ef322c56fa6bfcf87c6f6af7ed2281 (diff)
grok 4 new instructions which will show up in VIA C3 Esther, which
isn't that far away... xcrypt-ctr (AES ctr mode), montmul (montgomery multiply for 800 RSA sign/sec at 1024bit), and xsha1/xsha256 too.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/binutils/opcodes/i386-dis.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/opcodes/i386-dis.c b/gnu/usr.bin/binutils/opcodes/i386-dis.c
index 9e81d641155..cf7334c092e 100644
--- a/gnu/usr.bin/binutils/opcodes/i386-dis.c
+++ b/gnu/usr.bin/binutils/opcodes/i386-dis.c
@@ -91,6 +91,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_xcrypt2 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));
@@ -295,6 +296,7 @@ fetch_data (info, addr)
#define None OP_E, 0
#define OPSUF OP_3DNowSuffix, 0
#define OPXCRYPT OP_xcrypt, 0
+#define OPXCRYPT2 OP_xcrypt2, 0
#define OPSIMD OP_SIMD_Suffix, 0
#define cond_jump_flag NULL, cond_jump_mode
@@ -944,7 +946,7 @@ static const struct dis386 dis386_twobyte[] = {
{ "btS", Ev, Gv, XX },
{ "shldS", Ev, Gv, Ib },
{ "shldS", Ev, Gv, CL },
- { "(bad)", XX, XX, XX },
+ { "", OPXCRYPT2, XX, XX },
{ "", OPXCRYPT, XX, XX },
{ "(bad)", XX, XX, XX },
/* a8 */
@@ -3982,10 +3984,20 @@ static struct {
{ 0xc0, "xstore-rng" },
{ 0xc8, "xcrypt-ecb" },
{ 0xd0, "xcrypt-cbc" },
+ { 0xd8, "xcrypt-ctr" },
{ 0xe0, "xcrypt-cfb" },
{ 0xe8, "xcrypt-ofb" },
};
+static struct {
+ unsigned char opc;
+ char *name;
+} xcrypt2[] = {
+ { 0xc0, "montmul" },
+ { 0xc8, "xsha1" },
+ { 0xd0, "xsha256" },
+};
+
static const char *const Suffix3DNow[] = {
/* 00 */ NULL, NULL, NULL, NULL,
/* 04 */ NULL, NULL, NULL, NULL,
@@ -4104,6 +4116,30 @@ OP_xcrypt (bytemode, sizeflag)
BadOp();
}
+static void
+OP_xcrypt2 (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 xcrypt2 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(xcrypt2) / sizeof(xcrypt2[0]); i++)
+ if (xcrypt2[i].opc == (*codep & 0xff))
+ mnemonic = xcrypt2[i].name;
+ codep++;
+ if (mnemonic)
+ oappend (mnemonic);
+ else
+ BadOp();
+}
+
static const char *simd_cmp_op[] = {
"eq",
"lt",