Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/56504 )

Change subject: arch-x86: Emit macroops automatically instead of when decoded.
......................................................................

arch-x86: Emit macroops automatically instead of when decoded.

Emit code for macroops automatically when they are assembled, instead of
waiting until they are encountered in the decoder. This further isolates
the microops from the decoder definition and the ISA description.

Change-Id: Id2477d83a5456c105b1002f1b6e0442e74b562c6
---
M src/arch/x86/isa/macroop.isa
M src/arch/x86/isa/microasm.isa
2 files changed, 17 insertions(+), 4 deletions(-)



diff --git a/src/arch/x86/isa/macroop.isa b/src/arch/x86/isa/macroop.isa
index 115c274..1fed9d5 100644
--- a/src/arch/x86/isa/macroop.isa
+++ b/src/arch/x86/isa/macroop.isa
@@ -101,10 +101,6 @@
         if not Name in macroopDict:
             raise Exception("Unrecognized instruction: {}".format(Name))
         macroop = macroopDict[Name]
-        if not macroop.declared:
-            blocks.header_output = macroop.getDeclaration()
-            blocks.decoder_output = macroop.getDefinition()
-            macroop.declared = True
         blocks.decode_block = "return %s;\n" % macroop.getAllocator(env)
         return blocks
 }};
diff --git a/src/arch/x86/isa/microasm.isa b/src/arch/x86/isa/microasm.isa
index 434eba0..8499f6c 100644
--- a/src/arch/x86/isa/microasm.isa
+++ b/src/arch/x86/isa/microasm.isa
@@ -64,4 +64,8 @@

     decoder_output += mainRom.getDefinition()
     header_output += mainRom.getDeclaration()
+
+    for macroop in macroopDict.values():
+        decoder_output += macroop.getDefinition()
+        header_output += macroop.getDeclaration()
 }};

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

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id2477d83a5456c105b1002f1b6e0442e74b562c6
Gerrit-Change-Number: 56504
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to