From 6ee841319f759073119d765723023f9281be751b Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 8 Sep 2016 20:01:05 +0200 Subject: [PATCH] gsdx: help stupid compiler to allow 32 byte move Default copy-constructor is eight 32 bits move GSRendererOGL::Lines2Sprites code shrinks from 510B to 398B (loop of the function 296B => 181B). Hopefully it will reduce the cost to convert line to sprite on the CPU (i.e. when geometry shader is disabled) --- plugins/GSdx/GSVertex.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/GSdx/GSVertex.h b/plugins/GSdx/GSVertex.h index 5d6b82135f..3e50000500 100644 --- a/plugins/GSdx/GSVertex.h +++ b/plugins/GSdx/GSVertex.h @@ -41,10 +41,21 @@ struct alignas(32) GSVertex uint32 FOG; // FOG:28 }; +#if _M_SSE >= 0x500 + __m256i mx; +#endif __m128i m[2]; }; + GSVertex() = default; // Warning object is potentially used in hot path + +#if _M_SSE >= 0x500 + GSVertex(const GSVertex& v) {mx = v.mx;} + void operator = (const GSVertex& v) {mx = v.mx;} +#else + GSVertex(const GSVertex& v) {m[0] = v.m[0]; m[1] = v.m[1];} void operator = (const GSVertex& v) {m[0] = v.m[0]; m[1] = v.m[1];} +#endif }; struct GSVertexP