Anthony Gutierrez has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/29961 )

Change subject: arch-gcn3: Add memcpy condition when writing EXEC_LO
......................................................................

arch-gcn3: Add memcpy condition when writing EXEC_LO

Some compilers emit an error on the operand template class when writing
exec mask. Add a condition to explicitly set memcpy size argument to
32b or 64b based on the number of dwords.

Change-Id: I49b0e4a1680283e772d0a5a8efd687b31d4f1624
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29961
Reviewed-by: Anthony Gutierrez <anthony.gutier...@amd.com>
Reviewed-by: Matt Sinclair <mattdsincl...@gmail.com>
Maintainer: Anthony Gutierrez <anthony.gutier...@amd.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/gcn3/operand.hh
1 file changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved
  Matt Sinclair: Looks good to me, but someone else must approve
  kokoro: Regressions pass



diff --git a/src/arch/gcn3/operand.hh b/src/arch/gcn3/operand.hh
index 9d28deb..97c6310 100644
--- a/src/arch/gcn3/operand.hh
+++ b/src/arch/gcn3/operand.hh
@@ -437,8 +437,15 @@
                 if (_opIdx == REG_EXEC_LO) {
                     ScalarRegU64 new_exec_mask_val
                         = wf->execMask().to_ullong();
-                    std::memcpy((void*)&new_exec_mask_val,
-                        (void*)srfData.data(), sizeof(srfData));
+                    if (NumDwords == 1) {
+                        std::memcpy((void*)&new_exec_mask_val,
+                            (void*)srfData.data(), sizeof(VecElemU32));
+                    } else if (NumDwords == 2) {
+                        std::memcpy((void*)&new_exec_mask_val,
+                            (void*)srfData.data(), sizeof(VecElemU64));
+                    } else {
+ panic("Trying to write more than 2 DWORDS to EXEC\n");
+                    }
                     VectorMask new_exec_mask(new_exec_mask_val);
                     wf->execMask() = new_exec_mask;
                     DPRINTF(GPUSRF, "Write EXEC\n");

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29961
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: I49b0e4a1680283e772d0a5a8efd687b31d4f1624
Gerrit-Change-Number: 29961
Gerrit-PatchSet: 8
Gerrit-Owner: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Anthony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Matt Sinclair <mattdsincl...@gmail.com>
Gerrit-Reviewer: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-Reviewer: Tony Gutierrez <anthony.gutier...@amd.com>
Gerrit-Reviewer: Tuan Ta <q...@cornell.edu>
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