From 14dffa762b0f394390aa4dd6fda9b05d02821568 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Thu, 14 Jan 2016 23:20:48 +0000 Subject: [PATCH] gsdx: Add runion_ordered to GSVector Allows to save a few instructions cycles when xy and zw are already sorted (min and max rectangle coords). --- plugins/GSdx/GSVector.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/plugins/GSdx/GSVector.h b/plugins/GSdx/GSVector.h index 835eb0dcdc..cacef41350 100644 --- a/plugins/GSdx/GSVector.h +++ b/plugins/GSdx/GSVector.h @@ -239,15 +239,7 @@ public: if(i == 0xffff) { - #if _M_SSE >= 0x401 - - return min_i32(a).upl64(max_i32(a).srl<8>()); - - #else - - return GSVector4i(min(x, a.x), min(y, a.y), max(z, a.z), max(w, a.w)); - - #endif + return runion_ordered(a); } if((i & 0x00ff) == 0x00ff) @@ -263,6 +255,19 @@ public: return GSVector4i::zero(); } + __forceinline GSVector4i runion_ordered(const GSVector4i& a) const + { + #if _M_SSE >= 0x401 + + return min_i32(a).upl64(max_i32(a).srl<8>()); + + #else + + return GSVector4i(min(x, a.x), min(y, a.y), max(z, a.z), max(w, a.w)); + + #endif + } + __forceinline GSVector4i rintersect(const GSVector4i& a) const { return sat_i32(a);