skia2/tests/sksl/runtime/RecursiveComparison_Structs.skvm
John Stiles 059d34594e Optimize SkVM bit-clears.
SkVM has a `bit_clear` opcode dedicated to the operation `x & ~y`, but
the optimizer was not smart enough to combine a bit-and with a bit-not
and replace it with a bit-clear. Now, it can.

Change-Id: Ida5345c3def0a4bf7afa08bb7f7835e1e2e37677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524225
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
2022-03-24 21:04:23 +00:00

136 lines
3.3 KiB
Plaintext

25 registers, 133 instructions:
0 r0 = uniform32 ptr0 4
1 r1 = uniform32 ptr0 8
2 r2 = uniform32 ptr0 C
3 r3 = uniform32 ptr0 10
4 r4 = uniform32 ptr0 14
5 r5 = uniform32 ptr0 18
6 r6 = uniform32 ptr0 1C
7 r7 = uniform32 ptr0 20
8 r8 = splat 0 (0)
9 r9 = div_f32 r0 r2
10 r10 = div_f32 r2 r0
11 r11 = mul_f32 r0 r2
12 r8 = sub_f32 r8 r0
13 r8 = mul_f32 r2 r8
14 r12 = splat 42280000 (42)
15 r12 = mul_f32 r1 r12
16 r13 = splat 422C0000 (43)
17 r13 = mul_f32 r1 r13
18 r14 = splat 42300000 (44)
19 r14 = mul_f32 r1 r14
20 r15 = splat 3F800000 (1)
21 r15 = add_f32 r0 r15
22 r16 = mul_f32 r12 r15
23 r17 = mul_f32 r8 r15
24 r18 = mul_f32 r11 r15
25 r19 = eq_f32 r12 r16
26 r20 = eq_f32 r8 r17
27 r21 = eq_f32 r11 r18
28 r20 = bit_and r19 r20
29 r20 = bit_and r21 r20
30 r21 = bit_and r12 r20
31 r19 = bit_and r8 r20
32 r22 = bit_and r11 r20
33 r23 = bit_and r16 r20
34 r17 = bit_and r17 r20
35 r18 = bit_and r18 r20
36 r23 = neq_f32 r21 r23
37 r17 = neq_f32 r19 r17
38 r18 = neq_f32 r22 r18
39 r17 = bit_or r23 r17
40 r17 = bit_or r18 r17
41 r17 = bit_and r20 r17
42 r17 = bit_clear r20 r17
43 r20 = bit_and r12 r17
44 r18 = bit_and r9 r17
45 r23 = bit_and r10 r17
46 r22 = bit_and r16 r17
47 r19 = mul_f32 r9 r15
48 r21 = bit_and r17 r19
49 r15 = mul_f32 r10 r15
50 r24 = bit_and r17 r15
51 r22 = neq_f32 r20 r22
52 r21 = neq_f32 r18 r21
53 r24 = neq_f32 r23 r24
54 r21 = bit_or r22 r21
55 r21 = bit_or r24 r21
56 r21 = bit_and r17 r21
57 r21 = bit_and r17 r21
58 r17 = bit_and r12 r21
59 r24 = bit_and r9 r21
60 r10 = bit_and r10 r21
61 r16 = bit_and r16 r21
62 r19 = bit_and r19 r21
63 r15 = bit_and r15 r21
64 r16 = eq_f32 r17 r16
65 r19 = eq_f32 r24 r19
66 r15 = eq_f32 r10 r15
67 r19 = bit_and r16 r19
68 r19 = bit_and r15 r19
69 r19 = bit_and r21 r19
70 r19 = bit_clear r21 r19
71 r21 = splat 40000000 (2)
72 r21 = add_f32 r0 r21
73 r15 = bit_and r12 r19
74 r16 = bit_and r13 r19
75 r10 = bit_and r14 r19
76 r24 = mul_f32 r12 r21
77 r17 = bit_and r19 r24
78 r22 = mul_f32 r13 r21
79 r23 = bit_and r19 r22
80 r17 = neq_f32 r15 r17
81 r23 = neq_f32 r16 r23
82 r10 = neq_f32 r10 r10
83 r23 = bit_or r17 r23
84 r23 = bit_or r10 r23
85 r23 = bit_and r19 r23
86 r23 = bit_and r19 r23
87 r12 = bit_and r12 r23
88 r13 = bit_and r13 r23
89 r14 = bit_and r14 r23
90 r24 = bit_and r24 r23
91 r22 = bit_and r22 r23
92 r24 = eq_f32 r12 r24
93 r22 = eq_f32 r13 r22
94 r14 = eq_f32 r14 r14
95 r22 = bit_and r24 r22
96 r22 = bit_and r14 r22
97 r22 = bit_and r23 r22
98 r22 = bit_clear r23 r22
99 r23 = bit_and r9 r22
100 r14 = bit_and r8 r22
101 r24 = bit_and r11 r22
102 r13 = mul_f32 r9 r21
103 r12 = bit_and r22 r13
104 r21 = mul_f32 r8 r21
105 r19 = bit_and r22 r21
106 r12 = neq_f32 r23 r12
107 r19 = neq_f32 r14 r19
108 r24 = neq_f32 r24 r24
109 r19 = bit_or r12 r19
110 r19 = bit_or r24 r19
111 r19 = bit_and r22 r19
112 r19 = bit_and r22 r19
113 r9 = bit_and r9 r19
114 r8 = bit_and r8 r19
115 r11 = bit_and r11 r19
116 r13 = bit_and r13 r19
117 r21 = bit_and r21 r19
118 r13 = eq_f32 r9 r13
119 r21 = eq_f32 r8 r21
120 r11 = eq_f32 r11 r11
121 r21 = bit_and r13 r21
122 r21 = bit_and r11 r21
123 r21 = bit_and r19 r21
124 r21 = bit_clear r19 r21
125 r4 = select r21 r0 r4
126 r5 = select r21 r1 r5
127 r6 = select r21 r2 r6
128 r7 = select r21 r3 r7
loop:
129 store32 ptr1 r4
130 store32 ptr2 r5
131 store32 ptr3 r6
132 store32 ptr4 r7