Sandipan Das has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/16609

Change subject: arch-power: Add fixed-point doubleword load and store instructions
......................................................................

arch-power: Add fixed-point doubleword load and store instructions

This adds the following load and store instructions:
  * Load Doubleword (ld)
  * Load Doubleword Indexed (ldx)
  * Load Doubleword with Update (ldu)
  * Load Doubleword with Update Indexed (ldux)
  * Store Doubleword (std)
  * Store Doubleword Indexed (stdx)
  * Store Doubleword with Update (stdu)
  * Store Doubleword with Update Indexed (stdux)

Change-Id: I57a95003b6c6cfc09cc40f9ac03b32a8dfd7b26d
Signed-off-by: Sandipan Das <[email protected]>
---
M src/arch/power/isa/decoder.isa
M src/arch/power/isa/formats/mem.isa
2 files changed, 59 insertions(+), 0 deletions(-)



diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa
index 67639ad..bf2692c 100644
--- a/src/arch/power/isa/decoder.isa
+++ b/src/arch/power/isa/decoder.isa
@@ -152,6 +152,21 @@
     58: decode DS_XO {
         format LoadDispShiftOp {
             2: lwa({{ Rt = Mem_sw; }});
+            0: ld({{ Rt = Mem; }});
+        }
+
+        format LoadDispShiftUpdateOp {
+            1: ldu({{ Rt = Mem; }});
+        }
+    }
+
+    62: decode DS_XO {
+        format StoreDispShiftOp {
+            0: std({{ Mem = Rs; }});
+        }
+
+        format StoreDispShiftUpdateOp {
+            1: stdu({{ Mem = Rs; }});
         }
     }

@@ -254,6 +269,7 @@
             23: lwzx({{ Rt = Mem_uw; }});
             341: lwax({{ Rt = Mem_sw; }});
20: lwarx({{ Rt = Mem_uw; Rsv = 1; RsvLen = 4; RsvAddr = EA; }});
+            21: ldx({{ Rt = Mem; }});
             535: lfsx({{ Ft_sf = Mem_sf; }});
             599: lfdx({{ Ft = Mem_df; }});
             855: lfiwax({{ Ft_uw = Mem; }});
@@ -265,6 +281,7 @@
             375: lhaux({{ Rt = Mem_sh; }});
             55: lwzux({{ Rt = Mem_uw; }});
             373: lwaux({{ Rt = Mem_sw; }});
+            53: ldux({{ Rt = Mem; }});
             567: lfsux({{ Ft_sf = Mem_sf; }});
             631: lfdux({{ Ft = Mem_df; }});
         }
@@ -289,12 +306,14 @@
                 CR = cr;
                 Rsv = 0;
             }});
+            149: stdx({{ Mem = Rs }});
         }

         format StoreIndexUpdateOp {
             247: stbux({{ Mem_ub = Rs_ub; }});
             439: sthux({{ Mem_uh = Rs_uh; }});
             183: stwux({{ Mem_uw = Rs_uw; }});
+            181: stdux({{ Mem = Rs; }});
         }

         format IntOp {
diff --git a/src/arch/power/isa/formats/mem.isa b/src/arch/power/isa/formats/mem.isa
index 31c050e..eaf7552 100644
--- a/src/arch/power/isa/formats/mem.isa
+++ b/src/arch/power/isa/formats/mem.isa
@@ -308,6 +308,16 @@
 }};


+def format StoreDispShiftOp(memacc_code,
+                            ea_code = {{ EA = Ra + (disp << 2); }},
+                            ea_code_ra0 = {{ EA = (disp << 2); }},
+                            mem_flags = [], inst_flags = []) {{
+    (header_output, decoder_output, decode_block, exec_output) = \
+        GenMemOp(name, Name, memacc_code, ea_code, ea_code_ra0,
+                 'MemDispShiftOp', 'Store', mem_flags, inst_flags)
+}};
+
+
 def format LoadDispUpdateOp(memacc_code, ea_code = {{ EA = Ra + disp; }},
                             mem_flags = [], inst_flags = []) {{

@@ -334,3 +344,33 @@
                       base_class = 'MemDispOp',
                       exec_template_base = 'Store')
 }};
+
+
+def format LoadDispShiftUpdateOp(memacc_code,
+                                 ea_code = {{ EA = Ra + (disp << 2); }},
+                                 mem_flags = [], inst_flags = []) {{
+
+    # Add in the update code
+    memacc_code += 'Ra = EA;'
+
+    # Generate the class
+    (header_output, decoder_output, decode_block, exec_output) = \
+ LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+                      base_class = 'MemDispShiftOp',
+                      exec_template_base = 'Load')
+}};
+
+
+def format StoreDispShiftUpdateOp(memacc_code,
+                                  ea_code = {{ EA = Ra + (disp << 2); }},
+                                  mem_flags = [], inst_flags = []) {{
+
+    # Add in the update code
+    memacc_code += 'Ra = EA;'
+
+    # Generate the class
+    (header_output, decoder_output, decode_block, exec_output) = \
+ LoadStoreBase(name, Name, ea_code, memacc_code, mem_flags, inst_flags,
+                      base_class = 'MemDispShiftOp',
+                      exec_template_base = 'Store')
+}};

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I57a95003b6c6cfc09cc40f9ac03b32a8dfd7b26d
Gerrit-Change-Number: 16609
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to