From: Chris Duncan Date: Tue, 14 Jan 2025 21:14:27 +0000 (-0800) Subject: Replace more m scalar operations. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=be638e4e0eaccd582292e635185aac1a9ed7424f;p=nano-pow.git Replace more m scalar operations. --- diff --git a/src/shaders/compute.wgsl b/src/shaders/compute.wgsl index a93a421..2a9eae9 100644 --- a/src/shaders/compute.wgsl +++ b/src/shaders/compute.wgsl @@ -1394,11 +1394,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v2 + m0; - o1 = v3 + m1; - o1 = o1 + select(0u, 1u, o0 < v2); - v2 = o0; - v3 = o1; + v_23.x = v2; + v_23.y = v3; + v_23 = v_23 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_23.x + m0 < v_23.x); + v2 = v_23.x; + v3 = v_23.y; // d = rotr64(d ^ a, 32) v_23.x = v2; @@ -1640,11 +1640,12 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v6 + m6; - o1 = v7 + m7; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m6, m7) + select(vec2(0u), vec2(0u, 1u), v_67.x + m6 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; + // d = rotr64(d ^ a, 16) v_67.x = v6; @@ -1836,11 +1837,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v2 + m0; - o1 = v3 + m1; - o1 = o1 + select(0u, 1u, o0 < v2); - v2 = o0; - v3 = o1; + v_23.x = v2; + v_23.y = v3; + v_23 = v_23 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_23.x + m0 < v_23.x); + v2 = v_23.x; + v3 = v_23.y; // d = rotr64(d ^ a, 16) v_23.x = v2; @@ -1937,11 +1938,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v4 + m4; - o1 = v5 + m5; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_45.x + m4 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 16) v_45.x = v4; @@ -2329,11 +2330,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v4 + m2; - o1 = v5 + m3; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_45.x + m2 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 16) v_45.x = v4; @@ -2430,11 +2431,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v6 + m8; - o1 = v7 + m9; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m8, m9) + select(vec2(0u), vec2(0u, 1u), v_67.x + m8 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 16) v_67.x = v6; @@ -2630,11 +2631,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v2 + m2; - o1 = v3 + m3; - o1 = o1 + select(0u, 1u, o0 < v2); - v2 = o0; - v3 = o1; + v_23.x = v2; + v_23.y = v3; + v_23 = v_23 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_23.x + m2 < v_23.x); + v2 = v_23.x; + v3 = v_23.y; // d = rotr64(d ^ a, 16) v_23.x = v2; @@ -2879,11 +2880,8 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m4; - o1 = v_01.y + m5; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_01.x + m4 < v_01.x); + @@ -3125,11 +3123,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v4 + m0; - o1 = v5 + m1; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_45.x + m0 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 16) v_45.x = v4; @@ -3477,11 +3475,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v4 + m4; - o1 = v5 + m5; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_45.x + m4 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 32) v_45.x = v4; @@ -3968,11 +3966,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v6 + m6; - o1 = v7 + m7; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m6, m7) + select(vec2(0u), vec2(0u, 1u), v_67.x + m6 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 32) v_67.x = v6; @@ -4071,11 +4069,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v_01.x + m4; - o1 = v_01.y + m5; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_01.x + m4 < v_01.x); @@ -4267,11 +4261,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v4 + m0; - o1 = v5 + m1; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_45.x + m0 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 32) v_45.x = v4; @@ -4412,11 +4406,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v6 + m6; - o1 = v7 + m7; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m6, m7) + select(vec2(0u), vec2(0u, 1u), v_67.x + m6 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 16) v_67.x = v6; @@ -4958,11 +4952,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v2 + m2; - o1 = v3 + m3; - o1 = o1 + select(0u, 1u, o0 < v2); - v2 = o0; - v3 = o1; + v_23.x = v2; + v_23.y = v3; + v_23 = v_23 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_23.x + m2 < v_23.x); + v2 = v_23.x; + v3 = v_23.y; // d = rotr64(d ^ a, 32) v_23.x = v2; @@ -5156,11 +5150,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v6 + m8; - o1 = v7 + m9; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m8, m9) + select(vec2(0u), vec2(0u, 1u), v_67.x + m8 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 32) v_67.x = v6; @@ -5501,11 +5495,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v4 + m4; - o1 = v5 + m5; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_45.x + m4 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 16) v_45.x = v4; @@ -5891,11 +5885,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v4 + m2; - o1 = v5 + m3; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_45.x + m2 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 16) v_45.x = v4; @@ -5948,11 +5942,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v6 + m6; - o1 = v7 + m7; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m6, m7) + select(vec2(0u), vec2(0u, 1u), v_67.x + m6 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 32) v_67.x = v6; @@ -6881,11 +6875,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v_01.x + m4; - o1 = v_01.y + m5; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_01.x + m4 < v_01.x); @@ -7037,11 +7027,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v4 + m2; - o1 = v5 + m3; - o1 = o1 + select(0u, 1u, o0 < v4); - v4 = o0; - v5 = o1; + v_45.x = v4; + v_45.y = v5; + v_45 = v_45 + vec2(m2, m3) + select(vec2(0u), vec2(0u, 1u), v_45.x + m2 < v_45.x); + v4 = v_45.x; + v5 = v_45.y; // d = rotr64(d ^ a, 32) v_45.x = v4; @@ -7281,11 +7271,7 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v_01.x + m4; - o1 = v_01.y + m5; - o1 = o1 + select(0u, 1u, o0 < v_01.x); - v_01.x = o0; - v_01.y = o1; + v_01 = v_01 + vec2(m4, m5) + select(vec2(0u), vec2(0u, 1u), v_01.x + m4 < v_01.x); @@ -9313,11 +9299,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+0]] - o0 = v2 + m0; - o1 = v3 + m1; - o1 = o1 + select(0u, 1u, o0 < v2); - v2 = o0; - v3 = o1; + v_23.x = v2; + v_23.y = v3; + v_23 = v_23 + vec2(m0, m1) + select(vec2(0u), vec2(0u, 1u), v_23.x + m0 < v_23.x); + v2 = v_23.x; + v3 = v_23.y; // d = rotr64(d ^ a, 32) v_23.x = v2; @@ -9559,11 +9545,11 @@ fn main(@builtin(global_invocation_id) id: vec3) { // a = a + m[sigma[r][2*i+1]] - o0 = v6 + m6; - o1 = v7 + m7; - o1 = o1 + select(0u, 1u, o0 < v6); - v6 = o0; - v7 = o1; + v_67.x = v6; + v_67.y = v7; + v_67 = v_67 + vec2(m6, m7) + select(vec2(0u), vec2(0u, 1u), v_67.x + m6 < v_67.x); + v6 = v_67.x; + v7 = v_67.y; // d = rotr64(d ^ a, 16) v_67.x = v6;