Matthew Poremba has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/50827 )

Change subject: arch-vega: Issue flat insts using on executedAs()
......................................................................

arch-vega: Issue flat insts using on executedAs()

Similar to the flags issue in the previous patch, the FlatGlobal flag
does not exist. Change all of the flat instructions to use the same
issue logic as GCN3. A helper function is also added as loads and stores
use the same interface. The helper function can be more easily updated
to support global and scratch subtypes of flat instructions.

Change-Id: I394f1d4c59b029201fe2f6075c9dedb3a37dbe31
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50827
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Reviewed-by: Kyle Roarty <kyleroarty1...@gmail.com>
Maintainer: Matt Sinclair <mattdsincl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/amdgpu/vega/insts/instructions.cc
M src/arch/amdgpu/vega/insts/op_encodings.hh
2 files changed, 36 insertions(+), 108 deletions(-)

Approvals:
  Matt Sinclair: Looks good to me, approved; Looks good to me, approved
  Kyle Roarty: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/amdgpu/vega/insts/instructions.cc b/src/arch/amdgpu/vega/insts/instructions.cc
index afd750a..cf5c415 100644
--- a/src/arch/amdgpu/vega/insts/instructions.cc
+++ b/src/arch/amdgpu/vega/insts/instructions.cc
@@ -42814,12 +42814,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -42907,12 +42902,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43001,12 +42991,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43065,12 +43050,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43129,12 +43109,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43202,12 +43177,7 @@

         calcAddr(gpuDynInst, addr, instData.OFFSET);

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43279,7 +43249,6 @@
         addr.read();
         data.read();

-
         calcAddr(gpuDynInst, addr, instData.OFFSET);

         for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
@@ -43289,12 +43258,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43353,12 +43317,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43417,12 +43376,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43473,6 +43427,8 @@
         addr.read();
         data.read();

+        calcAddr(gpuDynInst, addr, instData.OFFSET);
+
         for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
             if (gpuDynInst->exec_mask[lane]) {
                 (reinterpret_cast<VecElemU64*>(gpuDynInst->d_data))[lane]
@@ -43480,14 +43436,7 @@
             }
         }

-        calcAddr(gpuDynInst, addr, instData.OFFSET);
-
-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43555,12 +43504,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43632,13 +43576,7 @@
             }
         }

-
-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe
-                .issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43704,12 +43642,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe.
-                issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43795,12 +43728,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe.
-                issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -43870,6 +43798,7 @@
         data.read();

         calcAddr(gpuDynInst, addr, instData.OFFSET);
+
         for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
             if (gpuDynInst->exec_mask[lane]) {
                 (reinterpret_cast<VecElemU32*>(gpuDynInst->a_data))[lane]
@@ -43877,12 +43806,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe.
-                issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -44265,6 +44189,8 @@
         data.read();
         cmp.read();

+        calcAddr(gpuDynInst, addr, instData.OFFSET);
+
         for (int lane = 0; lane < NumVecElemPerVecReg; ++lane) {
             if (gpuDynInst->exec_mask[lane]) {
                 (reinterpret_cast<VecElemU64*>(gpuDynInst->x_data))[lane]
@@ -44274,14 +44200,7 @@
             }
         }

-        calcAddr(gpuDynInst, addr, instData.OFFSET);
-
-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe.
-                issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
@@ -44360,12 +44279,7 @@
             }
         }

-        if (isFlatGlobal()) {
-            gpuDynInst->computeUnit()->globalMemoryPipe.
-                issueRequest(gpuDynInst);
-        } else {
-            fatal("Non global flat instructions not implemented yet.\n");
-        }
+        issueRequestHelper(gpuDynInst);
     } // execute

     void
diff --git a/src/arch/amdgpu/vega/insts/op_encodings.hh b/src/arch/amdgpu/vega/insts/op_encodings.hh
index 83e559b..8ca48d3 100644
--- a/src/arch/amdgpu/vega/insts/op_encodings.hh
+++ b/src/arch/amdgpu/vega/insts/op_encodings.hh
@@ -804,6 +804,20 @@
             gpuDynInst->resolveFlatSegment(gpuDynInst->exec_mask);
         }

+        void
+        issueRequestHelper(GPUDynInstPtr gpuDynInst)
+        {
+            if (gpuDynInst->executedAs() == enums::SC_GLOBAL) {
+                gpuDynInst->computeUnit()->globalMemoryPipe
+                    .issueRequest(gpuDynInst);
+            } else if (gpuDynInst->executedAs() == enums::SC_GROUP) {
+                gpuDynInst->computeUnit()->localMemoryPipe
+                    .issueRequest(gpuDynInst);
+            } else {
+                fatal("Unsupported scope for flat instruction.\n");
+            }
+        }
+
         // first instruction DWORD
         InFmt_FLAT instData;
         // second instruction DWORD

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50827
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: I394f1d4c59b029201fe2f6075c9dedb3a37dbe31
Gerrit-Change-Number: 50827
Gerrit-PatchSet: 2
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Kyle Roarty <kyleroarty1...@gmail.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
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