OSDN Git Service

Fix sign masks of narrow vectors.
authorNicolas Capens <capn@google.com>
Wed, 26 Jul 2017 17:50:04 +0000 (13:50 -0400)
committerNicolas Capens <nicolascapens@google.com>
Wed, 26 Jul 2017 20:12:10 +0000 (20:12 +0000)
The SignMask intrinsic returns the most significant bit of each byte in
a 128-bit vector. For 'emulated' 8-byte vectors we expect the upper
half to be ignored.

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

index 49163a7..31f0aaf 100644 (file)
@@ -289,7 +289,6 @@ namespace sw
                        }
                }
 
-
                return symbolValue;
        }
 
@@ -2865,7 +2864,7 @@ namespace sw
                        movmsk->addArg(x.value);
                        ::basicBlock->appendInst(movmsk);
 
-                       return RValue<Int>(V(result));
+                       return RValue<Int>(V(result)) & 0xFF;
                }
        }
 
@@ -3141,7 +3140,7 @@ namespace sw
                        movmsk->addArg(x.value);
                        ::basicBlock->appendInst(movmsk);
 
-                       return RValue<Int>(V(result));
+                       return RValue<Int>(V(result)) & 0xFF;
                }
        }