From 1fbee92044a82a6fcef312ee866bc288f1197cca Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Wed, 11 Jan 2017 20:13:53 +0100 Subject: [PATCH] gsdx tc: add a comment for a potential "ASM" optimization I'm not sure it worth it yet. But a generic function would be nice for future. --- plugins/GSdx/GSTextureCache.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 23bfcd8383..92e5ae33cb 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -1989,6 +1989,9 @@ void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, GSOffset* while(_BitScanForward(&j, p)) { + // FIXME: this statement could be optimized to a single ASM instruction (instead of 4) + // Either BTR (AKA bit test and reset). Depends on the previous instruction. + // Or BLSR (AKA Reset Lowest Set Bit). No dependency but require BMI1 (basically a recent CPU) p ^= 1 << j; m[j].push_front(s);