From 30d1c83669cde497bd6816d05b62e1cfd37146d2 Mon Sep 17 00:00:00 2001 From: Michal Ludvig Date: Fri, 30 Jul 2004 12:36:38 +0000 Subject: [PATCH] Added new instructions for next version of VIA PadLock core. --- gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/i386/padlock.d | 6 ++++++ gas/testsuite/gas/i386/padlock.s | 6 ++++++ include/opcode/ChangeLog | 4 ++++ include/opcode/i386.h | 3 +++ opcodes/ChangeLog | 7 +++++++ opcodes/i386-dis.c | 22 +++++++++++++++++----- 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 465b4e4dd4..7f42e59afa 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-30 Michal Ludvig + + * gas/i386/padlock.s, gas/i386/padlock.d: New tests for + VIA PadLock instructions. + 2004-07-29 Kaz Kojima * gas/sh/basic.exp: Don't do sh2a test for sh5. diff --git a/gas/testsuite/gas/i386/padlock.d b/gas/testsuite/gas/i386/padlock.d index a239a8c1a8..a85f1049d0 100644 --- a/gas/testsuite/gas/i386/padlock.d +++ b/gas/testsuite/gas/i386/padlock.d @@ -18,4 +18,10 @@ Disassembly of section .text: 23:[ ]*f3 0f a7 e8 [ ]*repz xcryptofb 27:[ ]*0f a7 c0 [ ]*xstorerng 2a:[ ]*f3 0f a7 c0 [ ]*repz xstorerng + 2e:[ ]*f3 0f a6 c0 [ ]*repz montmul + 32:[ ]*f3 0f a6 c0 [ ]*repz montmul + 36:[ ]*f3 0f a6 c8 [ ]*repz xsha1 + 3a:[ ]*f3 0f a6 c8 [ ]*repz xsha1 + 3e:[ ]*f3 0f a6 d0 [ ]*repz xsha256 + 42:[ ]*f3 0f a6 d0 [ ]*repz xsha256 [ ]*\.\.\. diff --git a/gas/testsuite/gas/i386/padlock.s b/gas/testsuite/gas/i386/padlock.s index e0caa41f14..b4a19506b2 100644 --- a/gas/testsuite/gas/i386/padlock.s +++ b/gas/testsuite/gas/i386/padlock.s @@ -14,5 +14,11 @@ foo: rep xcryptofb xstore rep xstore + montmul + rep montmul + xsha1 + rep xsha1 + xsha256 + rep xsha256 .p2align 4,0 diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 4ed2b86790..684a2e7c46 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2004-08-30 Michal Ludvig + + * i386.h (i386_optab): Added montmul/xsha1/xsha256 insns. + 2004-07-22 H.J. Lu * i386.h (i386_optab): Allow cs/ds in 64bit for branch hints. diff --git a/include/opcode/i386.h b/include/opcode/i386.h index 454a7fd09f..96bf149d59 100644 --- a/include/opcode/i386.h +++ b/include/opcode/i386.h @@ -1378,6 +1378,9 @@ static const template i386_optab[] = {"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} }, +{"montmul", 0, 0xf30fa6c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, +{"xsha1", 0, 0xf30fa6c8, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, +{"xsha256", 0, 0xf30fa6d0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, /* Alias for xstorerng. */ {"xstore", 0, 0x000fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 0736a82c7f..adf1a09f8c 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2004-07-30 Michal Ludvig + + * i386-dis.c (GRPPADLCK): Renamed to GRPPADLCK1 + (GRPPADLCK2): New define. + (twobyte_has_modrm): True for 0xA6. + (grps): GRPPADLCK2 for opcode 0xA6. + 2004-07-29 Alexandre Oliva Introduce SH2a support. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 733267c640..66fd388a45 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -389,7 +389,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr) #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 GRPPADLCK NULL, NULL, USE_GROUPS, NULL, 23, NULL, 0 +#define GRPPADLCK1 NULL, NULL, USE_GROUPS, NULL, 23, NULL, 0 +#define GRPPADLCK2 NULL, NULL, USE_GROUPS, NULL, 24, 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 @@ -948,8 +949,8 @@ static const struct dis386 dis386_twobyte[] = { { "btS", Ev, Gv, XX }, { "shldS", Ev, Gv, Ib }, { "shldS", Ev, Gv, CL }, - { "(bad)", XX, XX, XX }, - { GRPPADLCK }, + { GRPPADLCK2 }, + { GRPPADLCK1 }, /* a8 */ { "pushT", gs, XX, XX }, { "popT", gs, XX, XX }, @@ -1087,7 +1088,7 @@ static const unsigned char twobyte_has_modrm[256] = { /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1, /* 7f */ /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */ /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */ - /* a0 */ 0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,1, /* af */ + /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */ /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */ /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */ /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */ @@ -1451,7 +1452,7 @@ static const struct dis386 grps[][8] = { { "(bad)", XX, XX, XX }, { "(bad)", XX, XX, XX }, }, - /* GRPPADLCK */ + /* GRPPADLCK1 */ { { "xstorerng", OP_0f07, 0, XX, XX }, { "xcryptecb", OP_0f07, 0, XX, XX }, @@ -1461,6 +1462,17 @@ static const struct dis386 grps[][8] = { { "xcryptofb", OP_0f07, 0, XX, XX }, { "(bad)", OP_0f07, 0, XX, XX }, { "(bad)", OP_0f07, 0, XX, XX }, + }, + /* GRPPADLCK2 */ + { + { "montmul", OP_0f07, 0, XX, XX }, + { "xsha1", OP_0f07, 0, XX, XX }, + { "xsha256", OP_0f07, 0, XX, XX }, + { "(bad)", OP_0f07, 0, XX, XX }, + { "(bad)", OP_0f07, 0, XX, XX }, + { "(bad)", OP_0f07, 0, XX, XX }, + { "(bad)", OP_0f07, 0, XX, XX }, + { "(bad)", OP_0f07, 0, XX, XX }, } };