gpu-compute: Fixed a bug in decoding Atomic ST
authorTuan Ta <taquangtuan1992@gmail.com>
Sat, 18 Jun 2016 17:02:13 +0000 (13:02 -0400)
committerTuan Ta <taquangtuan1992@gmail.com>
Sat, 18 Jun 2016 17:02:13 +0000 (13:02 -0400)
There is a mismatch between DataType and SrcDataType in constructing
Atomic ST instruction. The mismatch causes atomic_store and
atomic_store_explicit function to store incorrect value in memory.

src/arch/hsail/insts/mem.hh

index 1db98d212d7f09b97b01330b8c47ae9809493dc9..acc8434be071be87b5a66b88bb222a44e765e4b0 100644 (file)
@@ -1556,11 +1556,11 @@ namespace HsailISA
               case Brig::BRIG_TYPE_B8:
                 return decodeSt<S8,S8>(ib, obj);
               case Brig::BRIG_TYPE_B16:
-                return decodeSt<S8,S16>(ib, obj);
+                return decodeSt<S16,S16>(ib, obj);
               case Brig::BRIG_TYPE_B32:
-                return decodeSt<S8,S32>(ib, obj);
+                return decodeSt<S32,S32>(ib, obj);
               case Brig::BRIG_TYPE_B64:
-                return decodeSt<S8,S64>(ib, obj);
+                return decodeSt<S64,S64>(ib, obj);
               default: fatal("AtomicSt: Operand type mismatch %d\n", ib->type);
             }
         } else {