Commit a8385ed6 by Logan Chien Committed by Chris Forbes

Reactor: Add check to SSE-specifc code for UShort4

Bug: b/115344057 Change-Id: I57d9cc936349c9f788a9bf791f55958caa6cbb73 Reviewed-on: https://swiftshader-review.googlesource.com/20930Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 40a6005e
...@@ -3631,12 +3631,14 @@ namespace sw ...@@ -3631,12 +3631,14 @@ namespace sw
{ {
if(saturate) if(saturate)
{ {
#if defined(__i386__) || defined(__x86_64__)
if(CPUID::supportsSSE4_1()) if(CPUID::supportsSSE4_1())
{ {
Int4 int4(Min(cast, Float4(0xFFFF))); // packusdw takes care of 0x0000 saturation Int4 int4(Min(cast, Float4(0xFFFF))); // packusdw takes care of 0x0000 saturation
*this = As<Short4>(PackUnsigned(int4, int4)); *this = As<Short4>(PackUnsigned(int4, int4));
} }
else else
#endif
{ {
*this = Short4(Int4(Max(Min(cast, Float4(0xFFFF)), Float4(0x0000)))); *this = Short4(Int4(Max(Min(cast, Float4(0xFFFF)), Float4(0x0000))));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment