OSDN Git Service

Remove sub-vector load/store address hack.
authorNicolas Capens <capn@google.com>
Thu, 27 Jul 2017 18:21:46 +0000 (14:21 -0400)
committerNicolas Capens <nicolascapens@google.com>
Tue, 1 Aug 2017 17:53:58 +0000 (17:53 +0000)
The Optimizer used to assume that loads and stores using the same
address are of the same tpe. This is false for emulated sub-vector
load/store, and thus we tricked it into thinking the addresses are
different by performing some redundant arithmetic. This is no longer
necessary now that the Optimizer checks the types being loaded/stored.

Bug swiftshader:48

Change-Id: Ic212d67fefd9e8dd902ff576b69458208c3c379d
Reviewed-on: https://swiftshader-review.googlesource.com/11088
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
src/Reactor/SubzeroReactor.cpp

index 31f0aaf..7e607d9 100644 (file)
@@ -853,7 +853,7 @@ namespace sw
                                if(typeSize(type) == 4)
                                {
                                        auto pointer = RValue<Pointer<Byte>>(ptr);
-                                       Int x = *Pointer<Int>(pointer +1-1);
+                                       Int x = *Pointer<Int>(pointer);
 
                                        Int4 vector;
                                        vector = Insert(vector, x, 0);
@@ -864,7 +864,7 @@ namespace sw
                                else if(typeSize(type) == 8)
                                {
                                        auto pointer = RValue<Pointer<Byte>>(ptr);
-                                       Int x = *Pointer<Int>(pointer +1-1);
+                                       Int x = *Pointer<Int>(pointer);
                                        Int y = *Pointer<Int>(pointer + 4);
 
                                        Int4 vector;