Refactor vector packing. x86 vector packing instructions always treat the input as having signed integer components, but can perform signed or unsigned saturation on the output. In Reactor the Pack() intrinsic has overloads which differentiate between them based on the signedness of the input, but this is confusing. Also simplify emulation of saturating add/subtract. Bug b/37496082 Change-Id: I0625fff429ffb40f42baf9600c7760d9858b5d89 Reviewed-on: https://swiftshader-review.googlesource.com/12548 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Shader/PixelPipeline.cpp b/src/Shader/PixelPipeline.cpp index 66d6a09..4ed1830 100644 --- a/src/Shader/PixelPipeline.cpp +++ b/src/Shader/PixelPipeline.cpp
@@ -1665,7 +1665,7 @@ void PixelPipeline::TEXKILL(Int cMask[4], Vector4s &src) { Short4 test = src.x | src.y | src.z; - Int kill = SignMask(Pack(test, test)) ^ 0x0000000F; + Int kill = SignMask(PackSigned(test, test)) ^ 0x0000000F; for(unsigned int q = 0; q < state.multiSample; q++) {