]> zoso.dev Git - nano-pow.git/commitdiff
Replace more 32-bit scalar rotations with vector rotations.
authorChris Duncan <chris@zoso.dev>
Tue, 14 Jan 2025 18:45:08 +0000 (10:45 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 14 Jan 2025 18:45:08 +0000 (10:45 -0800)
src/shaders/compute.wgsl

index 8b5ef92f3de84b1e8043f042acbcb9d5509455b8..a484a8df65b093910edafb315a176a2801768bdd 100644 (file)
@@ -428,10 +428,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -1168,10 +1171,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -1902,10 +1908,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -2630,10 +2639,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -3373,10 +3385,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -4122,10 +4137,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -4859,10 +4877,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -5596,10 +5617,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -6333,10 +6357,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -7076,10 +7103,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -7816,10 +7846,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;
@@ -8556,10 +8589,13 @@ fn main(@builtin(global_invocation_id) id: vec3<u32>) {
        // v7 = o1;
 
        // d = rotr64(d ^ a, 32)
-       xor0 = v30 ^ v6;
-       xor1 = v31 ^ v7;
-       v30 = xor1;
-       v31 = xor0;
+       v_67.x = v6;
+       v_67.y = v7;
+       v_3031.x = v30;
+       v_3031.y = v31;
+       v_3031 = v_3031 ^ v_67;
+       v30 = v_3031.y;
+       v31 = v_3031.x;
 
        // c = c + d
        v_2223.x = v22;