gpu-compute: Explicitly use little endian packet accessors.
authorGabe Black <gabeblack@google.com>
Fri, 12 Oct 2018 12:09:27 +0000 (05:09 -0700)
committerGabe Black <gabeblack@google.com>
Wed, 17 Oct 2018 23:38:47 +0000 (23:38 +0000)
The gpu ISA doesn't have a well defined endianness, but it really
should. It seems that the GPU is only used with x86, and in that
context it would be little endian.

Change-Id: I1620906564a77f44553fbf6d788866e017b6054b
Reviewed-on: https://gem5-review.googlesource.com/c/13463
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

src/gpu-compute/dispatcher.cc

index 41e632dd6dba6244055d6f99f1f57291b350ec4b..db250c28bf174a449a955704b0abe14a34c3c89e 100644 (file)
@@ -139,7 +139,7 @@ GpuDispatcher::read(PacketPtr pkt)
         assert(pkt->getSize() == 8);
 
         uint64_t retval = dispatchActive;
-        pkt->set(retval);
+        pkt->setLE(retval);
     } else {
         offset -= 8;
         assert(offset + pkt->getSize() < sizeof(HsaQueueEntry));
@@ -166,16 +166,16 @@ GpuDispatcher::write(PacketPtr pkt)
 
     switch (pkt->getSize()) {
       case 1:
-        data_val = pkt->get<uint8_t>();
+        data_val = pkt->getLE<uint8_t>();
         break;
       case 2:
-        data_val = pkt->get<uint16_t>();
+        data_val = pkt->getLE<uint16_t>();
         break;
       case 4:
-        data_val = pkt->get<uint32_t>();
+        data_val = pkt->getLE<uint32_t>();
         break;
       case 8:
-        data_val = pkt->get<uint64_t>();
+        data_val = pkt->getLE<uint64_t>();
         break;
       default:
         DPRINTF(GPUDisp, "bad size %d\n", pkt->getSize());