From c02908d2c016356ad1027f85b70643c7017dafd2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 12 Mar 2004 07:01:37 +0000 Subject: [PATCH] opcodes/ * i386-dis.c (grps): Use clflush by default for 0x0fae/7. (OP_E): Twiddle clflush to sfence here. gas/testsuite/ * gas/i386/katmai.d: Adjust for clflush change. --- gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/i386/katmai.d | 2 +- opcodes/ChangeLog | 5 +++++ opcodes/i386-dis.c | 16 +++++++++++----- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index aeb9d1f337b..63ea4758d6a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-03-12 Alan Modra + + * gas/i386/katmai.d: Adjust for clflush change. + 2004-03-08 Andreas Jaeger * gas/cfi/cfi-s390x-1.d: Adjust offsets. diff --git a/gas/testsuite/gas/i386/katmai.d b/gas/testsuite/gas/i386/katmai.d index b1fc77d86e5..0ccdc0844d1 100644 --- a/gas/testsuite/gas/i386/katmai.d +++ b/gas/testsuite/gas/i386/katmai.d @@ -165,7 +165,7 @@ Disassembly of section .text: 246: 90 [ ]*nop 247: 90 [ ]*nop 248: 65 [ ]*gs - 249: 0f [ ]*sfence.*\(bad\).* + 249: 0f [ ]*clflush.*\(bad\).* 24a: ae [ ]*scas %es:\(%edi\),%al 24b: ff 00 [ ]*incl \(%eax\) 24d: 00 00 [ ]*add %al,\(%eax\) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 47790f36b7f..545c37b5e00 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2004-03-12 Alan Modra + + * i386-dis.c (grps): Use clflush by default for 0x0fae/7. + (OP_E): Twiddle clflush to sfence here. + 2004-03-08 Nick Clifton * po/de.po: Updated German translation. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index f9a0a9b2c45..067c7502090 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1426,8 +1426,7 @@ static const struct dis386 grps[][8] = { { "(bad)", XX, XX, XX }, { "lfence", None, XX, XX }, { "mfence", None, XX, XX }, - { "sfence", None, XX, XX }, - /* FIXME: the sfence with memory operand is clflush! */ + { "clflush", None, XX, XX }, }, /* GRP14 */ { @@ -3034,9 +3033,16 @@ OP_E (int bytemode, int sizeflag) used_prefixes |= (prefixes & PREFIX_DATA); break; case 0: - if (!(codep[-2] == 0xAE && codep[-1] == 0xF8 /* sfence */) - && !(codep[-2] == 0xAE && codep[-1] == 0xF0 /* mfence */) - && !(codep[-2] == 0xAE && codep[-1] == 0xe8 /* lfence */)) + if (codep[-2] == 0xAE && codep[-1] == 0xF8) + /* sfence */ + strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence"); + else if (codep[-2] == 0xAE && codep[-1] == 0xF0) + /* mfence */ + ; + else if (codep[-2] == 0xAE && codep[-1] == 0xe8) + /* lfence */ + ; + else BadOp (); /* bad sfence,lea,lds,les,lfs,lgs,lss modrm */ break; default: -- 2.30.2