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

Change subject: arch-x86: Use X, Y suffixes with those op types.
......................................................................

arch-x86: Use X, Y suffixes with those op types.

When a macroop uses X or Y type operand specifiers, the specializeInst
funciton would use a _M suffix for the macroop name. There's no reason
to use _M, since the instructions that use these operand types are
inherently not general and can't get their memory addresses from
different places, and wouldn't anyway.

By making these macroops use a _X or _Y suffix instead, this makes the
macroop level disassembly consistent for any given suffix. Before, the
correct disassembly for _M would be different for X, Y, or any other
type.

Change-Id: I7192da7c6271144a7583b66e4dca13d57db29d67
---
M src/arch/x86/isa/insts/general_purpose/input_output/string_io.ucode
M src/arch/x86/isa/insts/general_purpose/string/compare_strings.ucode
M src/arch/x86/isa/insts/general_purpose/string/load_string.ucode
M src/arch/x86/isa/insts/general_purpose/string/move_string.ucode
M src/arch/x86/isa/insts/general_purpose/string/scan_string.ucode
M src/arch/x86/isa/insts/general_purpose/string/store_string.ucode
M src/arch/x86/isa/specialize.isa
7 files changed, 41 insertions(+), 21 deletions(-)



diff --git a/src/arch/x86/isa/insts/general_purpose/input_output/string_io.ucode b/src/arch/x86/isa/insts/general_purpose/input_output/string_io.ucode
index c807895..d7c3f0c 100644
--- a/src/arch/x86/isa/insts/general_purpose/input_output/string_io.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/input_output/string_io.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop INS_M_R {
+def macroop INS_Y_R {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -51,11 +51,11 @@
     add rdi, rdi, t3, dataSize=asz
 };

-def macroop INS_VIRT_M_R {
+def macroop INS_VIRT_Y_R {
     panic "Virtual mode ins isn't implemented!"
 };

-def macroop INS_E_M_R {
+def macroop INS_E_Y_R {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)
     # Find the constant we need to either add or subtract from rdi
@@ -80,11 +80,11 @@
     fault "NoFault"
 };

-def macroop INS_VIRT_E_M_R {
+def macroop INS_VIRT_E_Y_R {
     panic "Virtual mode ins isn't implemented!"
 };

-def macroop OUTS_R_M {
+def macroop OUTS_R_X {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -102,11 +102,11 @@
     add rsi, rsi, t3, dataSize=asz
 };

-def macroop OUTS_VIRT_R_M {
+def macroop OUTS_VIRT_R_X {
     panic "Virtual mode outs isn't implemented!"
 };

-def macroop OUTS_E_R_M {
+def macroop OUTS_E_R_X {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)
     # Find the constant we need to either add or subtract from rdi
@@ -131,6 +131,6 @@
     fault "NoFault"
 };

-def macroop OUTS_VIRT_E_R_M {
+def macroop OUTS_VIRT_E_R_X {
     panic "Virtual mode outs isn't implemented!"
 };
diff --git a/src/arch/x86/isa/insts/general_purpose/string/compare_strings.ucode b/src/arch/x86/isa/insts/general_purpose/string/compare_strings.ucode
index 2a60ae0..f1b2f93 100644
--- a/src/arch/x86/isa/insts/general_purpose/string/compare_strings.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/string/compare_strings.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop CMPS_M_M {
+def macroop CMPS_Y_X {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -53,7 +53,7 @@
 # unrolling.
 #

-def macroop CMPS_E_M_M {
+def macroop CMPS_E_Y_X {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)

@@ -76,7 +76,7 @@
     fault "NoFault"
 };

-def macroop CMPS_N_M_M {
+def macroop CMPS_N_Y_X {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)

diff --git a/src/arch/x86/isa/insts/general_purpose/string/load_string.ucode b/src/arch/x86/isa/insts/general_purpose/string/load_string.ucode
index 83c82e9..4440bb0 100644
--- a/src/arch/x86/isa/insts/general_purpose/string/load_string.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/string/load_string.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop LODS_M {
+def macroop LODS_X {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -45,7 +45,7 @@
     add rsi, rsi, t3, dataSize=asz
 };

-def macroop LODS_E_M {
+def macroop LODS_E_X {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)
     # Find the constant we need to either add or subtract from rdi
diff --git a/src/arch/x86/isa/insts/general_purpose/string/move_string.ucode b/src/arch/x86/isa/insts/general_purpose/string/move_string.ucode
index 8d37435..f645616 100644
--- a/src/arch/x86/isa/insts/general_purpose/string/move_string.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/string/move_string.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop MOVS_M_M {
+def macroop MOVS_Y_X {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -47,7 +47,7 @@
     add rsi, rsi, t3, dataSize=asz
 };

-def macroop MOVS_E_M_M {
+def macroop MOVS_E_Y_X {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)
     # Find the constant we need to either add or subtract from rdi
diff --git a/src/arch/x86/isa/insts/general_purpose/string/scan_string.ucode b/src/arch/x86/isa/insts/general_purpose/string/scan_string.ucode
index 8a62de7..354f697 100644
--- a/src/arch/x86/isa/insts/general_purpose/string/scan_string.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/string/scan_string.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop SCAS_M {
+def macroop SCAS_Y {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t2, t2, dsz, flags=(CEZF,), dataSize=asz
@@ -51,7 +51,7 @@
 # unrolling.
 #

-def macroop SCAS_E_M {
+def macroop SCAS_E_Y {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)

@@ -72,7 +72,7 @@
     fault "NoFault"
 };

-def macroop SCAS_N_M {
+def macroop SCAS_N_Y {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)

diff --git a/src/arch/x86/isa/insts/general_purpose/string/store_string.ucode b/src/arch/x86/isa/insts/general_purpose/string/store_string.ucode
index bf7e75e..eccc801 100644
--- a/src/arch/x86/isa/insts/general_purpose/string/store_string.ucode
+++ b/src/arch/x86/isa/insts/general_purpose/string/store_string.ucode
@@ -33,7 +33,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-def macroop STOS_M {
+def macroop STOS_Y {
     # Find the constant we need to either add or subtract from rdi
     ruflag t0, 10
     movi t3, t3, dsz, flags=(CEZF,), dataSize=asz
@@ -45,7 +45,7 @@
     add rdi, rdi, t3, dataSize=asz
 };

-def macroop STOS_E_M {
+def macroop STOS_E_Y {
     and t0, rcx, rcx, flags=(EZF,), dataSize=asz
     br label("end"), flags=(CEZF,)
     # Find the constant we need to either add or subtract from rdi
diff --git a/src/arch/x86/isa/specialize.isa b/src/arch/x86/isa/specialize.isa
index 554b141..58f2f72 100644
--- a/src/arch/x86/isa/specialize.isa
+++ b/src/arch/x86/isa/specialize.isa
@@ -274,7 +274,7 @@
                             '''printMem(out, SEGMENT_REG_ES,
1, X86ISA::NUM_INTREGS, X86ISA::INTREG_RDI, 0,
                                 env.addressSize, false);''')
-                Name += '_M'
+                Name += ('_' + op_type.tag)
             else:
                 raise Exception('Unrecognized tag {}.'.format(op_type.tag))


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56498
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: I7192da7c6271144a7583b66e4dca13d57db29d67
Gerrit-Change-Number: 56498
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