Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/6825 )

Change subject: riscv,x86: Stop using the arch Nop machine instruction unnecessarily.
......................................................................

riscv,x86: Stop using the arch Nop machine instruction unnecessarily.

That particular ExtMachInst is a convenient placeholder, but a value
of 0 in RISCV or a static uninitialized ExtMachInst (which will
therefore be all zeroes) on x86 works just as well, and removes the
need for an ISA specific constant.

Also, the idea of a universal Nop doesn't always make sense since it
could be that what, exactly, doesn't do anything depends on context
which would be lost on a constant value of an ExtMachInst. For
instance, the value of an ExtMachInst that makes sense might depend on
what mode the CPU was in, etc.

Change-Id: I1f1a43a5c607a667e11b79bcf6e059e4f7141b3f
Reviewed-on: https://gem5-review.googlesource.com/6825
Reviewed-by: Gabe Black <[email protected]>
Reviewed-by: Alec Roelke <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/arch/riscv/decoder.cc
M src/arch/x86/insts/badmicroop.cc
M src/arch/x86/isa/microops/base.isa
3 files changed, 10 insertions(+), 4 deletions(-)

Approvals:
  Alec Roelke: Looks good to me, but someone else must approve
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/arch/riscv/decoder.cc b/src/arch/riscv/decoder.cc
index 020c5e3..41a5202 100644
--- a/src/arch/riscv/decoder.cc
+++ b/src/arch/riscv/decoder.cc
@@ -45,7 +45,7 @@
     aligned = true;
     mid = false;
     more = true;
-    emi = NoopMachInst;
+    emi = 0;
     instDone = false;
 }

diff --git a/src/arch/x86/insts/badmicroop.cc b/src/arch/x86/insts/badmicroop.cc
index 21af128..0924873 100644
--- a/src/arch/x86/insts/badmicroop.cc
+++ b/src/arch/x86/insts/badmicroop.cc
@@ -42,14 +42,21 @@
 #include "arch/x86/generated/decoder.hh"
 #include "arch/x86/isa_traits.hh"

+namespace {
+
+static X86ISA::ExtMachInst dummyMachInst;
+
+}
+
 namespace X86ISA
 {

 // This microop needs to be allocated on the heap even though it could
// theoretically be statically allocated. The reference counted pointer would
 // try to delete the static memory when it was destructed.
+
 const StaticInstPtr badMicroop =
-    new X86ISAInst::MicroPanic(NoopMachInst, "BAD",
+    new X86ISAInst::MicroPanic(dummyMachInst, "BAD",
         StaticInst::IsMicroop | StaticInst::IsLastMicroop,
         "Invalid microop!", 0);

diff --git a/src/arch/x86/isa/microops/base.isa b/src/arch/x86/isa/microops/base.isa
index dc36d0e..42e7d2e 100644
--- a/src/arch/x86/isa/microops/base.isa
+++ b/src/arch/x86/isa/microops/base.isa
@@ -59,8 +59,7 @@
             ''' + generatorNameTemplate + '''(StaticInstPtr curMacroop)
             {
                 static const char *macrocodeBlock = romMnemonic;
-                static const ExtMachInst dummyExtMachInst = \
-                    X86ISA::NoopMachInst;
+                static ExtMachInst dummyExtMachInst;
                 static const EmulEnv dummyEmulEnv(0, 0, 1, 1, 1);

Macroop * macroop = dynamic_cast<Macroop *>(curMacroop.get());

--
To view, visit https://gem5-review.googlesource.com/6825
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f1a43a5c607a667e11b79bcf6e059e4f7141b3f
Gerrit-Change-Number: 6825
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Assignee: Alec Roelke <[email protected]>
Gerrit-Reviewer: Alec Roelke <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-CC: Alec Roelke <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to