Debian Codegraph @

mysys/crc32/crc32c_amd64.cc

raw symbols SCIP
1 /* Copyright (c) 2020, 2021, MariaDB
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
15
16 /*
17 * Copyright 2016 Ferry Toth, Exalon Delft BV, The Netherlands
18 * This software is provided 'as-is', without any express or implied
19 * warranty. In no event will the author be held liable for any damages
20 * arising from the use of this software.
21 * Permission is granted to anyone to use this software for any purpose,
22 * including commercial applications, and to alter it and redistribute it
23 * freely, subject to the following restrictions:
24 * 1. The origin of this software must not be misrepresented; you must not
25 * claim that you wrote the original software. If you use this software
26 * in a product, an acknowledgment in the product documentation would be
27 * appreciated but is not required.
28 * 2. Altered source versions must be plainly marked as such, and must not be
29 * misrepresented as being the original software.
30 * 3. This notice may not be removed or altered from any source distribution.
31 * Ferry Toth
32 * [email protected]
33 *
34 * https://github.com/htot/crc32c
35 *
36 * Modified by Facebook
37 *
38 * Original intel whitepaper:
39 * "Fast CRC Computation for iSCSI Polynomial Using CRC32 Instruction"
40 * https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/crc-iscsi-polynomial-crc32-instruction-paper.pdf
41 *
42 * This version is from the folly library, created by Dave Watson <[email protected]>
43 *
44 */
45
46 #include <stdint.h>
47 #include <nmmintrin.h>
48 #include <wmmintrin.h>
49
50 #ifdef _MSC_VER
51 # define USE_PCLMUL /* nothing */
52 #else
53 # define USE_PCLMULcxx . . $ `mysys/crc32/crc32c_amd64.cc:53:10`! __attribute__((target("sse4.2,pclmul")))
54 #endif
55
56 #define CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, buf, offset) \
57 crc##0 = _mm_crc32_u64(crc##0, *(buf##0 + offset)); \
58 crc##1 = _mm_crc32_u64(crc##1, *(buf##1 + offset)); \
59 crc##2 = _mm_crc32_u64(crc##2, *(buf##2 + offset));
60
61 #define CRCdupletcxx . . $ `mysys/crc32/crc32c_amd64.cc:61:9`!(crc, buf, offset) \
62 crc##0 = _mm_crc32_u64(crc##0, *(buf##0 + offset)); \
63 crc##1 = _mm_crc32_u64(crc##1, *(buf##1 + offset));
64
65 #define CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc, buf, offset) \
66 crc = _mm_crc32_u64(crc, *(uint64_t*)(buf + offset));
67
68
69 // Numbers taken directly from intel whitepaper.
70 // clang-format off
71 static const uint64_tcxx . . $ uint64_t# clmul_constantscxx . . $ clmul_constants. alignas(16) [] = {
72 0x14cd00bd6, 0x105ec76f0, 0x0ba4fc28e, 0x14cd00bd6,
73 0x1d82c63da, 0x0f20c0dfe, 0x09e4addf8, 0x0ba4fc28e,
74 0x039d3b296, 0x1384aa63a, 0x102f9b8a2, 0x1d82c63da,
75 0x14237f5e6, 0x01c291d04, 0x00d3b6092, 0x09e4addf8,
76 0x0c96cfdc0, 0x0740eef02, 0x18266e456, 0x039d3b296,
77 0x0daece73e, 0x0083a6eec, 0x0ab7aff2a, 0x102f9b8a2,
78 0x1248ea574, 0x1c1733996, 0x083348832, 0x14237f5e6,
79 0x12c743124, 0x02ad91c30, 0x0b9e02b86, 0x00d3b6092,
80 0x018b33a4e, 0x06992cea2, 0x1b331e26a, 0x0c96cfdc0,
81 0x17d35ba46, 0x07e908048, 0x1bf2e8b8a, 0x18266e456,
82 0x1a3e0968a, 0x11ed1f9d8, 0x0ce7f39f4, 0x0daece73e,
83 0x061d82e56, 0x0f1d0f55e, 0x0d270f1a2, 0x0ab7aff2a,
84 0x1c3f5f66c, 0x0a87ab8a8, 0x12ed0daac, 0x1248ea574,
85 0x065863b64, 0x08462d800, 0x11eef4f8e, 0x083348832,
86 0x1ee54f54c, 0x071d111a8, 0x0b3e32c28, 0x12c743124,
87 0x0064f7f26, 0x0ffd852c6, 0x0dd7e3b0c, 0x0b9e02b86,
88 0x0f285651c, 0x0dcb17aa4, 0x010746f3c, 0x018b33a4e,
89 0x1c24afea4, 0x0f37c5aee, 0x0271d9844, 0x1b331e26a,
90 0x08e766a0c, 0x06051d5a2, 0x093a5f730, 0x17d35ba46,
91 0x06cb08e5c, 0x11d5ca20e, 0x06b749fb2, 0x1bf2e8b8a,
92 0x1167f94f2, 0x021f3d99c, 0x0cec3662e, 0x1a3e0968a,
93 0x19329634a, 0x08f158014, 0x0e6fc4e6a, 0x0ce7f39f4,
94 0x08227bb8a, 0x1a5e82106, 0x0b0cd4768, 0x061d82e56,
95 0x13c2b89c4, 0x188815ab2, 0x0d7a4825c, 0x0d270f1a2,
96 0x10f5ff2ba, 0x105405f3e, 0x00167d312, 0x1c3f5f66c,
97 0x0f6076544, 0x0e9adf796, 0x026f6a60a, 0x12ed0daac,
98 0x1a2adb74e, 0x096638b34, 0x19d34af3a, 0x065863b64,
99 0x049c3cc9c, 0x1e50585a0, 0x068bce87a, 0x11eef4f8e,
100 0x1524fa6c6, 0x19f1c69dc, 0x16cba8aca, 0x1ee54f54c,
101 0x042d98888, 0x12913343e, 0x1329d9f7e, 0x0b3e32c28,
102 0x1b1c69528, 0x088f25a3a, 0x02178513a, 0x0064f7f26,
103 0x0e0ac139e, 0x04e36f0b0, 0x0170076fa, 0x0dd7e3b0c,
104 0x141a1a2e2, 0x0bd6f81f8, 0x16ad828b4, 0x0f285651c,
105 0x041d17b64, 0x19425cbba, 0x1fae1cc66, 0x010746f3c,
106 0x1a75b4b00, 0x18db37e8a, 0x0f872e54c, 0x1c24afea4,
107 0x01e41e9fc, 0x04c144932, 0x086d8e4d2, 0x0271d9844,
108 0x160f7af7a, 0x052148f02, 0x05bb8f1bc, 0x08e766a0c,
109 0x0a90fd27a, 0x0a3c6f37a, 0x0b3af077a, 0x093a5f730,
110 0x04984d782, 0x1d22c238e, 0x0ca6ef3ac, 0x06cb08e5c,
111 0x0234e0b26, 0x063ded06a, 0x1d88abd4a, 0x06b749fb2,
112 0x04597456a, 0x04d56973c, 0x0e9e28eb4, 0x1167f94f2,
113 0x07b3ff57a, 0x19385bf2e, 0x0c9c8b782, 0x0cec3662e,
114 0x13a9cba9e, 0x0e417f38a, 0x093e106a4, 0x19329634a,
115 0x167001a9c, 0x14e727980, 0x1ddffc5d4, 0x0e6fc4e6a,
116 0x00df04680, 0x0d104b8fc, 0x02342001e, 0x08227bb8a,
117 0x00a2a8d7e, 0x05b397730, 0x168763fa6, 0x0b0cd4768,
118 0x1ed5a407a, 0x0e78eb416, 0x0d2c3ed1a, 0x13c2b89c4,
119 0x0995a5724, 0x1641378f0, 0x19b1afbc4, 0x0d7a4825c,
120 0x109ffedc0, 0x08d96551c, 0x0f2271e60, 0x10f5ff2ba,
121 0x00b0bf8ca, 0x00bf80dd2, 0x123888b7a, 0x00167d312,
122 0x1e888f7dc, 0x18dcddd1c, 0x002ee03b2, 0x0f6076544,
123 0x183e8d8fe, 0x06a45d2b2, 0x133d7a042, 0x026f6a60a,
124 0x116b0f50c, 0x1dd3e10e8, 0x05fabe670, 0x1a2adb74e,
125 0x130004488, 0x0de87806c, 0x000bcf5f6, 0x19d34af3a,
126 0x18f0c7078, 0x014338754, 0x017f27698, 0x049c3cc9c,
127 0x058ca5f00, 0x15e3e77ee, 0x1af900c24, 0x068bce87a,
128 0x0b5cfca28, 0x0dd07448e, 0x0ded288f8, 0x1524fa6c6,
129 0x059f229bc, 0x1d8048348, 0x06d390dec, 0x16cba8aca,
130 0x037170390, 0x0a3e3e02c, 0x06353c1cc, 0x042d98888,
131 0x0c4584f5c, 0x0d73c7bea, 0x1f16a3418, 0x1329d9f7e,
132 0x0531377e2, 0x185137662, 0x1d8d9ca7c, 0x1b1c69528,
133 0x0b25b29f2, 0x18a08b5bc, 0x19fb2a8b0, 0x02178513a,
134 0x1a08fe6ac, 0x1da758ae0, 0x045cddf4e, 0x0e0ac139e,
135 0x1a91647f2, 0x169cf9eb0, 0x1a0f717c4, 0x0170076fa,
136 };
137
138 // Compute the crc32c value for buffer smaller than 8
139 USE_PCLMULcxx . . $ `mysys/crc32/crc32c_amd64.cc:53:10`!
140 static inline void align_to_8cxx . . $ align_to_8(b99f9fe07087c898).(
141 size_t len,
142 uint64_tcxx . . $ uint64_t#& crc0, // crc so far, updated on return
143 const unsigned char*& next) { // next data pointer, updated on return
144 uint32_tcxx . . $ uint32_t# crc32bit = static_cast<uint32_tcxx . . $ uint32_t#>(crc0);
145 if (len & 0x04) {
146 crc32bit = _mm_crc32_u32cxx . . $ _mm_crc32_u32(83f10ac8959d5577).(crc32bit, *(uint32_tcxx . . $ uint32_t#*)next);
147 next += sizeof(uint32_tcxx . . $ uint32_t#);
148 }
149 if (len & 0x02) {
150 crc32bit = _mm_crc32_u16cxx . . $ _mm_crc32_u16(d18a354f71bab922).(crc32bit, *(uint16_tcxx . . $ uint16_t#*)next);
151 next += sizeof(uint16_tcxx . . $ uint16_t#);
152 }
153 if (len & 0x01) {
154 crc32bit = _mm_crc32_u8cxx . . $ _mm_crc32_u8(8b98654af71362dd).(crc32bit, *(next));
155 next++;
156 }
157 crc0 = crc32bit;
158 }
159
160 //
161 // CombineCRC performs pclmulqdq multiplication of 2 partial CRC's and a well
162 // chosen constant and xor's these with the remaining CRC.
163 //
164 USE_PCLMULcxx . . $ `mysys/crc32/crc32c_amd64.cc:53:10`!
165 static inline uint64_tcxx . . $ uint64_t# CombineCRCcxx . . $ CombineCRC(c4f52eacdc8cfd4e).(
166 size_t block_size,
167 uint64_tcxx . . $ uint64_t# crc0,
168 uint64_tcxx . . $ uint64_t# crc1,
169 uint64_tcxx . . $ uint64_t# crc2,
170 const uint64_tcxx . . $ uint64_t#* next2) {
171 const auto multiplier =
172 *(reinterpret_cast<const __m128icxx . . $ __m128i#*>(clmul_constantscxx . . $ clmul_constants.) + block_size - 1);
173 const auto crc0_xmm = _mm_set_epi64xcxx . . $ _mm_set_epi64x(ae3ffc5db66e1530).(0, crc0);
174 const auto res0 = _mm_clmulepi64_si128cxx . . $ _mm_clmulepi64_si128(33fb1d39db3c835a).(crc0_xmm, multiplier, 0x00);
175 const auto crc1_xmm = _mm_set_epi64xcxx . . $ _mm_set_epi64x(ae3ffc5db66e1530).(0, crc1);
176 const auto res1 = _mm_clmulepi64_si128cxx . . $ _mm_clmulepi64_si128(33fb1d39db3c835a).(crc1_xmm, multiplier, 0x10);
177 const auto res = _mm_xor_si128cxx . . $ _mm_xor_si128(e79ab442e937dade).(res0, res1);
178 crc0 = _mm_cvtsi128_si64cxx . . $ _mm_cvtsi128_si64(e1c7b7bb5bd643bd).(res);
179 crc0 = crc0 ^ *((uint64_tcxx . . $ uint64_t#*)next2 - 1);
180 crc2 = _mm_crc32_u64cxx . . $ _mm_crc32_u64(1d3b295cc4392655).(crc2, crc0);
181 return crc2;
182 }
183
184 // Compute CRC-32C using the Intel hardware instruction.
185 extern "C"
186 USE_PCLMULcxx . . $ `mysys/crc32/crc32c_amd64.cc:53:10`!
187 uint32_tcxx . . $ uint32_t# crc32c_3way(uint32_tcxx . . $ uint32_t# crc, const void *buf, size_t len)
188 {
189 const unsigned char* next = static_cast<const unsigned char*>(buf);
190 uint64_tcxx . . $ uint64_t# count;
191 uint64_tcxx . . $ uint64_t# crc0, crc1, crc2;
192 crc0 = crc ^ 0xffffffffu;
193
194
195 if (len >= 8) {
196 // if len > 216 then align and use triplets
197 if (len > 216) {
198 {
199 // Work on the bytes (< 8) before the first 8-byte alignment addr starts
200 auto align_bytes = (8 - (uintptr_tcxx . . $ uintptr_t#)next) & 7;
201 len -= align_bytes;
202 align_to_8cxx . . $ align_to_8(b99f9fe07087c898).(align_bytes, crc0, next);
203 }
204
205 // Now work on the remaining blocks
206 count = len / 24; // number of triplets
207 len %= 24; // bytes remaining
208 uint64_tcxx . . $ uint64_t# n = count >> 7; // #blocks = first block + full blocks
209 uint64_tcxx . . $ uint64_t# block_size = count & 127;
210 if (block_size == 0) {
211 block_size = 128;
212 } else {
213 n++;
214 }
215 // points to the first byte of the next block
216 const uint64_tcxx . . $ uint64_t#* next0 = (uint64_tcxx . . $ uint64_t#*)next + block_size;
217 const uint64_tcxx . . $ uint64_t#* next1 = next0 + block_size;
218 const uint64_tcxx . . $ uint64_t#* next2 = next1 + block_size;
219
220 crc1 = crc2 = 0;
221 // Use Duff's device, a for() loop inside a switch()
222 // statement. This needs to execute at least once, round len
223 // down to nearest triplet multiple
224 switch (block_size) {
225 case 128:
226 do {
227 // jumps here for a full block of len 128
228 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -128);
229 /* fallthrough */
230 case 127:
231 // jumps here or below for the first block smaller
232 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -127);
233 /* fallthrough */
234 case 126:
235 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -126); // than 128
236 /* fallthrough */
237 case 125:
238 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -125);
239 /* fallthrough */
240 case 124:
241 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -124);
242 /* fallthrough */
243 case 123:
244 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -123);
245 /* fallthrough */
246 case 122:
247 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -122);
248 /* fallthrough */
249 case 121:
250 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -121);
251 /* fallthrough */
252 case 120:
253 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -120);
254 /* fallthrough */
255 case 119:
256 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -119);
257 /* fallthrough */
258 case 118:
259 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -118);
260 /* fallthrough */
261 case 117:
262 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -117);
263 /* fallthrough */
264 case 116:
265 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -116);
266 /* fallthrough */
267 case 115:
268 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -115);
269 /* fallthrough */
270 case 114:
271 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -114);
272 /* fallthrough */
273 case 113:
274 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -113);
275 /* fallthrough */
276 case 112:
277 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -112);
278 /* fallthrough */
279 case 111:
280 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -111);
281 /* fallthrough */
282 case 110:
283 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -110);
284 /* fallthrough */
285 case 109:
286 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -109);
287 /* fallthrough */
288 case 108:
289 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -108);
290 /* fallthrough */
291 case 107:
292 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -107);
293 /* fallthrough */
294 case 106:
295 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -106);
296 /* fallthrough */
297 case 105:
298 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -105);
299 /* fallthrough */
300 case 104:
301 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -104);
302 /* fallthrough */
303 case 103:
304 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -103);
305 /* fallthrough */
306 case 102:
307 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -102);
308 /* fallthrough */
309 case 101:
310 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -101);
311 /* fallthrough */
312 case 100:
313 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -100);
314 /* fallthrough */
315 case 99:
316 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -99);
317 /* fallthrough */
318 case 98:
319 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -98);
320 /* fallthrough */
321 case 97:
322 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -97);
323 /* fallthrough */
324 case 96:
325 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -96);
326 /* fallthrough */
327 case 95:
328 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -95);
329 /* fallthrough */
330 case 94:
331 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -94);
332 /* fallthrough */
333 case 93:
334 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -93);
335 /* fallthrough */
336 case 92:
337 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -92);
338 /* fallthrough */
339 case 91:
340 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -91);
341 /* fallthrough */
342 case 90:
343 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -90);
344 /* fallthrough */
345 case 89:
346 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -89);
347 /* fallthrough */
348 case 88:
349 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -88);
350 /* fallthrough */
351 case 87:
352 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -87);
353 /* fallthrough */
354 case 86:
355 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -86);
356 /* fallthrough */
357 case 85:
358 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -85);
359 /* fallthrough */
360 case 84:
361 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -84);
362 /* fallthrough */
363 case 83:
364 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -83);
365 /* fallthrough */
366 case 82:
367 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -82);
368 /* fallthrough */
369 case 81:
370 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -81);
371 /* fallthrough */
372 case 80:
373 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -80);
374 /* fallthrough */
375 case 79:
376 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -79);
377 /* fallthrough */
378 case 78:
379 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -78);
380 /* fallthrough */
381 case 77:
382 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -77);
383 /* fallthrough */
384 case 76:
385 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -76);
386 /* fallthrough */
387 case 75:
388 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -75);
389 /* fallthrough */
390 case 74:
391 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -74);
392 /* fallthrough */
393 case 73:
394 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -73);
395 /* fallthrough */
396 case 72:
397 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -72);
398 /* fallthrough */
399 case 71:
400 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -71);
401 /* fallthrough */
402 case 70:
403 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -70);
404 /* fallthrough */
405 case 69:
406 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -69);
407 /* fallthrough */
408 case 68:
409 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -68);
410 /* fallthrough */
411 case 67:
412 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -67);
413 /* fallthrough */
414 case 66:
415 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -66);
416 /* fallthrough */
417 case 65:
418 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -65);
419 /* fallthrough */
420 case 64:
421 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -64);
422 /* fallthrough */
423 case 63:
424 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -63);
425 /* fallthrough */
426 case 62:
427 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -62);
428 /* fallthrough */
429 case 61:
430 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -61);
431 /* fallthrough */
432 case 60:
433 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -60);
434 /* fallthrough */
435 case 59:
436 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -59);
437 /* fallthrough */
438 case 58:
439 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -58);
440 /* fallthrough */
441 case 57:
442 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -57);
443 /* fallthrough */
444 case 56:
445 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -56);
446 /* fallthrough */
447 case 55:
448 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -55);
449 /* fallthrough */
450 case 54:
451 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -54);
452 /* fallthrough */
453 case 53:
454 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -53);
455 /* fallthrough */
456 case 52:
457 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -52);
458 /* fallthrough */
459 case 51:
460 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -51);
461 /* fallthrough */
462 case 50:
463 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -50);
464 /* fallthrough */
465 case 49:
466 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -49);
467 /* fallthrough */
468 case 48:
469 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -48);
470 /* fallthrough */
471 case 47:
472 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -47);
473 /* fallthrough */
474 case 46:
475 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -46);
476 /* fallthrough */
477 case 45:
478 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -45);
479 /* fallthrough */
480 case 44:
481 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -44);
482 /* fallthrough */
483 case 43:
484 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -43);
485 /* fallthrough */
486 case 42:
487 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -42);
488 /* fallthrough */
489 case 41:
490 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -41);
491 /* fallthrough */
492 case 40:
493 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -40);
494 /* fallthrough */
495 case 39:
496 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -39);
497 /* fallthrough */
498 case 38:
499 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -38);
500 /* fallthrough */
501 case 37:
502 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -37);
503 /* fallthrough */
504 case 36:
505 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -36);
506 /* fallthrough */
507 case 35:
508 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -35);
509 /* fallthrough */
510 case 34:
511 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -34);
512 /* fallthrough */
513 case 33:
514 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -33);
515 /* fallthrough */
516 case 32:
517 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -32);
518 /* fallthrough */
519 case 31:
520 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -31);
521 /* fallthrough */
522 case 30:
523 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -30);
524 /* fallthrough */
525 case 29:
526 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -29);
527 /* fallthrough */
528 case 28:
529 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -28);
530 /* fallthrough */
531 case 27:
532 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -27);
533 /* fallthrough */
534 case 26:
535 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -26);
536 /* fallthrough */
537 case 25:
538 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -25);
539 /* fallthrough */
540 case 24:
541 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -24);
542 /* fallthrough */
543 case 23:
544 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -23);
545 /* fallthrough */
546 case 22:
547 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -22);
548 /* fallthrough */
549 case 21:
550 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -21);
551 /* fallthrough */
552 case 20:
553 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -20);
554 /* fallthrough */
555 case 19:
556 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -19);
557 /* fallthrough */
558 case 18:
559 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -18);
560 /* fallthrough */
561 case 17:
562 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -17);
563 /* fallthrough */
564 case 16:
565 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -16);
566 /* fallthrough */
567 case 15:
568 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -15);
569 /* fallthrough */
570 case 14:
571 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -14);
572 /* fallthrough */
573 case 13:
574 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -13);
575 /* fallthrough */
576 case 12:
577 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -12);
578 /* fallthrough */
579 case 11:
580 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -11);
581 /* fallthrough */
582 case 10:
583 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -10);
584 /* fallthrough */
585 case 9:
586 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -9);
587 /* fallthrough */
588 case 8:
589 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -8);
590 /* fallthrough */
591 case 7:
592 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -7);
593 /* fallthrough */
594 case 6:
595 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -6);
596 /* fallthrough */
597 case 5:
598 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -5);
599 /* fallthrough */
600 case 4:
601 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -4);
602 /* fallthrough */
603 case 3:
604 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -3);
605 /* fallthrough */
606 case 2:
607 CRCtripletcxx . . $ `mysys/crc32/crc32c_amd64.cc:56:9`!(crc, next, -2);
608 /* fallthrough */
609 case 1:
610 CRCdupletcxx . . $ `mysys/crc32/crc32c_amd64.cc:61:9`!(crc, next, -1); // the final triplet is actually only 2
611 //{ CombineCRC(); }
612 crc0 = CombineCRCcxx . . $ CombineCRC(c4f52eacdc8cfd4e).(block_size, crc0, crc1, crc2, next2);
613 if (--n > 0) {
614 crc1 = crc2 = 0;
615 block_size = 128;
616 // points to the first byte of the next block
617 next0 = next2 + 128;
618 next1 = next0 + 128; // from here on all blocks are 128 long
619 next2 = next1 + 128;
620 }
621 /* fallthrough */
622 case 0:;
623 } while (n > 0);
624 }
625 next = (const unsigned char*)next2;
626 }
627 uint64_tcxx . . $ uint64_t# count2 = len >> 3; // 216 of less bytes is 27 or less singlets
628 len = len & 7;
629 next += (count2 * 8);
630 switch (count2) {
631 case 27:
632 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -27 * 8);
633 /* fallthrough */
634 case 26:
635 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -26 * 8);
636 /* fallthrough */
637 case 25:
638 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -25 * 8);
639 /* fallthrough */
640 case 24:
641 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -24 * 8);
642 /* fallthrough */
643 case 23:
644 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -23 * 8);
645 /* fallthrough */
646 case 22:
647 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -22 * 8);
648 /* fallthrough */
649 case 21:
650 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -21 * 8);
651 /* fallthrough */
652 case 20:
653 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -20 * 8);
654 /* fallthrough */
655 case 19:
656 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -19 * 8);
657 /* fallthrough */
658 case 18:
659 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -18 * 8);
660 /* fallthrough */
661 case 17:
662 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -17 * 8);
663 /* fallthrough */
664 case 16:
665 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -16 * 8);
666 /* fallthrough */
667 case 15:
668 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -15 * 8);
669 /* fallthrough */
670 case 14:
671 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -14 * 8);
672 /* fallthrough */
673 case 13:
674 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -13 * 8);
675 /* fallthrough */
676 case 12:
677 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -12 * 8);
678 /* fallthrough */
679 case 11:
680 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -11 * 8);
681 /* fallthrough */
682 case 10:
683 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -10 * 8);
684 /* fallthrough */
685 case 9:
686 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -9 * 8);
687 /* fallthrough */
688 case 8:
689 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -8 * 8);
690 /* fallthrough */
691 case 7:
692 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -7 * 8);
693 /* fallthrough */
694 case 6:
695 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -6 * 8);
696 /* fallthrough */
697 case 5:
698 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -5 * 8);
699 /* fallthrough */
700 case 4:
701 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -4 * 8);
702 /* fallthrough */
703 case 3:
704 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -3 * 8);
705 /* fallthrough */
706 case 2:
707 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -2 * 8);
708 /* fallthrough */
709 case 1:
710 CRCsingletcxx . . $ `mysys/crc32/crc32c_amd64.cc:65:9`!(crc0, next, -1 * 8);
711 /* fallthrough */
712 case 0:;
713 }
714 }
715 {
716 align_to_8cxx . . $ align_to_8(b99f9fe07087c898).(len, crc0, next);
717 return (uint32_tcxx . . $ uint32_t#)crc0 ^ 0xffffffffu;
718 }
719 }