From 72ce4eea35504b5ee3d624ae459aa7c9e9d2b048 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 20 Oct 2025 16:32:39 +0200 Subject: [PATCH] R_FlushQuad: dont use 64bit/8byte copy on 32bit targets on 32bit targets this will just compile into two 32bit copies which gcc cant optimize as well as it can with the byte copy (it seems to love to do some AVX stuff atleast in my tests) so this is only useful for 64bit capable platforms (compiler does not seem to do 64bit copys for the byte copy case, so this ends up being faster) --- src/r_draw_flush.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/r_draw_flush.cpp b/src/r_draw_flush.cpp index bc88ccca4..b135c6125 100644 --- a/src/r_draw_flush.cpp +++ b/src/r_draw_flush.cpp @@ -156,6 +156,7 @@ static void R_FlushQuad(void) if constexpr (Type & ColumnFlushType::FLUSH_OPAQUE) { +#if __SIZEOF_POINTER__ >= 8 // does not make much sense on 32bit targets // 8 byte aligned copy -- make sure our dest ptr, source ptr AND stride are a multiple of 8! if ((((uintptr_t)dest | (uintptr_t)source | stride) & 7) == 0) { @@ -170,6 +171,7 @@ static void R_FlushQuad(void) } } else +#endif { while (--count >= 0) {