The compare of card copies loads eight places at once (the same hashes)
Yard capture, 423 passes a frame, turn by turn: 1.93 -> 1.69 ms (4 loops; four at once 1.70, sixteen 1.71). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
4b3141fac5
commit
03fbb23b27
1 file changed
+30
-1
@@ -2003,8 +2003,37 @@ void main(uint3 id : SV_GroupID, uint thread : SV_GroupIndex) {
|
||||
lo = lo & ~15u;
|
||||
hi = (hi + 15u) & ~15u;
|
||||
uint4 h = uint4(0x9E3779B9u, 0x85EBCA6Bu, 0xC2B2AE35u, 0x27D4EB2Fu) + thread;
|
||||
uint at = lo + thread * 16u;
|
||||
// Eight loads at once: one after the other, each waits for memory.
|
||||
[loop]
|
||||
for (uint at = lo + thread * 16u; at < hi; at += 1024u) {
|
||||
for (; at + 7168u < hi; at += 8192u) {
|
||||
uint4 v0 = now.Load4(at + 0u);
|
||||
uint4 v1 = now.Load4(at + 1024u);
|
||||
uint4 v2 = now.Load4(at + 2048u);
|
||||
uint4 v3 = now.Load4(at + 3072u);
|
||||
uint4 v4 = now.Load4(at + 4096u);
|
||||
uint4 v5 = now.Load4(at + 5120u);
|
||||
uint4 v6 = now.Load4(at + 6144u);
|
||||
uint4 v7 = now.Load4(at + 7168u);
|
||||
h = (h ^ v0) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v1) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v2) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v3) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v4) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v5) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v6) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
h = (h ^ v7) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
}
|
||||
[loop]
|
||||
for (; at < hi; at += 1024u) {
|
||||
h = (h ^ now.Load4(at)) * uint4(0x01000193u, 0x9E3779B1u, 0x85EBCA77u, 0xC2B2AE3Du);
|
||||
h = h.yzwx ^ (h >> 15);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user