Uh oh!
There was an error while loading. Please reload this page.
Commit 8b7e3b2
erasure_code: optimize SVE/SVE2 dot product with XOR for coefficient=1
Optimize the GF(2^8) vector dot product implementation for ARM SVE/SVE2
by using direct XOR operations when the encoding coefficient is 1,
eliminating unnecessary table lookups.
Technical Details:
- Add is_dest_coeff_all_one() helper to detect coefficient=1 blocks
- Pre-compute coefficient status for each destination vector
- For coefficient=1 blocks: use direct XOR (src_data XOR accumulator)
- For other coefficients: use traditional nibble-based table lookup
- Optimization applied uniformly inside gf_nvect_dot_prod_sve_unrolled()
The optimization leverages the property that EC encoding matrices often
have coefficient 1 for the first parity block, making XOR operations
sufficient instead of full GF multiplication via table lookup.
Performance Results:
Kunpeng-920 (SVE):
+------------------+------------+------------+--------+
| Test Case | Before | After | Speedup|
+------------------+------------+------------+--------+
| 10+1 encode | 15 GB/s | 79 GB/s | 5.3x |
| 10+1 decode(1) | 15 GB/s | 78 GB/s | 5.2x |
| 4+2 encode | 19 GB/s | 23 GB/s | 1.2x |
| 4+2 decode(1) | 24 GB/s | 85 GB/s | 3.5x |
| 8+3 encode | 13 GB/s | 14 GB/s | 1.1x |
| 8+3 decode(1) | 21 GB/s | 77 GB/s | 3.7x |
+------------------+------------+------------+--------+
Kunpeng-950 (SVE2):
+------------------+------------+------------+--------+
| Test Case | Before | After | Speedup|
+------------------+------------+------------+--------+
| 10+1 encode | 13 GB/s | 84 GB/s | 6.5x |
| 10+1 decode(1) | 13 GB/s | 84 GB/s | 6.5x |
| 4+2 encode | 17 GB/s | 22 GB/s | 1.3x |
| 4+2 decode(1) | 24 GB/s | 85 GB/s | 3.5x |
| 8+3 encode | 12 GB/s | 14 GB/s | 1.2x |
| 8+3 decode(1) | 12 GB/s | 88 GB/s | 7.3x |
+------------------+------------+------------+--------+
Measured using erasure_code_perf tool on Huawei Kunpeng platforms.
Signed-off-by: Chenxuqiang <chenxuqiang3@hisilicon.com>
Signed-off-by: Enigmo <guotaowei4@huawei.com>1 parent adcbb2a commit 8b7e3b2
1 file changed
Lines changed: 68 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
78 | 94 | | |
79 | 95 | | |
80 | 96 | | |
| |||
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
141 | 165 | | |
142 | 166 | | |
143 | 167 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
169 | 203 | | |
170 | 204 | | |
171 | 205 | | |
| |||
0 commit comments