From 5f42810ebd43a9e79f99d7ed840223f60174964f Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 11 Apr 2005 12:58:16 +0000 Subject: [PATCH] include/opcode/ 2005-03-15 Jan Beulich * i386.h (i386_optab): Add rdtscp. opcodes/ 2005-03-15 Jan Beulich * i386-dis.c (INVLPG_Fixup): Decode rdtscp; change code to allow for easier future additions. --- include/opcode/ChangeLog | 4 ++++ include/opcode/i386.h | 1 + opcodes/ChangeLog | 5 +++++ opcodes/i386-dis.c | 23 +++++++++++++++-------- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 7844fee9f8b..2152ae57e70 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,7 @@ +2005-03-15 Jan Beulich + + * i386.h (i386_optab): Add rdtscp. + 2005-02-09 Jan Beulich PR gas/707 diff --git a/include/opcode/i386.h b/include/opcode/i386.h index 052f1272c8d..07163f07754 100644 --- a/include/opcode/i386.h +++ b/include/opcode/i386.h @@ -1369,6 +1369,7 @@ static const template i386_optab[] = {"syscall", 0, 0x0f05, X, CpuK6, NoSuf, { 0, 0, 0} }, {"sysret", 0, 0x0f07, X, CpuK6, lq_Suf|DefaultSize, { 0, 0, 0} }, {"swapgs", 0, 0x0f01, 0xf8, Cpu64, NoSuf|ImmExt, { 0, 0, 0} }, +{"rdtscp", 0, 0x0f01, 0xf9, CpuSledgehammer,NoSuf|ImmExt, { 0, 0, 0} }, /* VIA PadLock extensions. */ {"xstorerng", 0, 0x000fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 71c4097512f..08d6475fce8 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2005-03-15 Jan Beulich + + * i386-dis.c (INVLPG_Fixup): Decode rdtscp; change code to allow for + easier future additions. + 2005-03-19 Hans-Peter Nilsson * mmix-opc.c (O, Z): Force expression as unsigned long. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 24e5a393ed2..7fbd27f3240 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -4392,16 +4392,23 @@ PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag) static void INVLPG_Fixup (int bytemode, int sizeflag) { - if (*codep == 0xf8) - { - char *p = obuf + strlen (obuf); + const char *alt; - /* Override "invlpg". */ - strcpy (p - 6, "swapgs"); - codep++; + switch (*codep) + { + case 0xf8: + alt = "swapgs"; + break; + case 0xf9: + alt = "rdtscp"; + break; + default: + OP_E (bytemode, sizeflag); + return; } - else - OP_E (bytemode, sizeflag); + /* Override "invlpg". */ + strcpy (obuf + strlen (obuf) - 6, alt); + codep++; } static void -- 2.47.2