diff options
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 40 | ||||
-rw-r--r-- | include/opcode/ChangeLog | 5 | ||||
-rw-r--r-- | include/opcode/i386.h | 18 |
4 files changed, 36 insertions, 32 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index d79bea3..d756de3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2005-04-12 Mark Kettenis <kettenis@gnu.org> + + * config/tc-i386.c (output_insn): Handle VIA PadLock instructions + similar to other instructions now that they're marked as ImmExt. + 2005-04-12 Nick Clifton <nickc@redhat.com> * hash.c (DEFAULT_SIZE): Delete. Replace with: diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 83e2567..6aeb827 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3320,23 +3320,23 @@ output_insn () char *p; unsigned char *q; - /* 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); + /* All opcodes on i386 have either 1 or 2 bytes. We may use one + more higher byte to specify a prefix the instruction + requires. */ + if ((i.tm.base_opcode & 0xff0000) != 0) + { + if ((i.tm.cpu_flags & CpuPadLock) != 0) + { + unsigned int prefix; + prefix = (i.tm.base_opcode >> 16) & 0xff; + + if (prefix != REPE_PREFIX_OPCODE + || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) + add_prefix (prefix); + } + else + add_prefix ((i.tm.base_opcode >> 16) & 0xff); } - 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; @@ -3357,13 +3357,7 @@ output_insn () } else { - if ((i.tm.cpu_flags & CpuPadLock) != 0) - { - p = frag_more (3); - *p++ = (i.tm.base_opcode >> 16) & 0xff; - } - else - p = frag_more (2); + p = frag_more (2); /* Put out high byte first: can't use md_number_to_chars! */ *p++ = (i.tm.base_opcode >> 8) & 0xff; diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 175cb41..75daf1a 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,3 +1,8 @@ +2005-04-12 Mark Kettenis <kettenis@gnu.org> + + * i386.h (i386_optab): Mark VIA PadLock instructions as ImmExt and + adjust them accordingly. + 2005-04-01 Jan Beulich <jbeulich@novell.com> * i386.h (i386_optab): Add rdtscp. diff --git a/include/opcode/i386.h b/include/opcode/i386.h index ca80d0a..240acb9 100644 --- a/include/opcode/i386.h +++ b/include/opcode/i386.h @@ -1378,16 +1378,16 @@ static const template i386_optab[] = {"rdtscp", 0, 0x0f01, 0xf9, CpuSledgehammer,NoSuf|ImmExt, { 0, 0, 0} }, /* VIA PadLock extensions. */ -{"xstorerng", 0, 0x000fa7c0, 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} }, -{"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} }, +{"xstorerng", 0, 0x000fa7, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptecb", 0, 0xf30fa7, 0xc8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptcbc", 0, 0xf30fa7, 0xd0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptcfb", 0, 0xf30fa7, 0xe0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xcryptofb", 0, 0xf30fa7, 0xe8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"montmul", 0, 0xf30fa6, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xsha1", 0, 0xf30fa6, 0xc8, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, +{"xsha256", 0, 0xf30fa6, 0xd0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, /* Alias for xstorerng. */ -{"xstore", 0, 0x000fa7c0, X, Cpu686|CpuPadLock, NoSuf|IsString, { 0, 0, 0} }, +{"xstore", 0, 0x000fa7, 0xc0, Cpu686|CpuPadLock, NoSuf|IsString|ImmExt, { 0, 0, 0} }, /* sentinel */ {NULL, 0, 0, 0, 0, 0, { 0, 0, 0} } |