Commit 936546d
committed
Optimize pg_comp_crc32c_sse42 routine slightly, and also use it on x86.
Eliminate the separate 'len' variable from the loops, and also use the 4
byte instruction. This shaves off a few more cycles. Even though this
routine that uses the special SSE 4.2 instructions is much faster than a
generic routine, it's still a hot spot, so let's make it as fast as
possible.
Change the configure test to not test _mm_crc32_u64. That variant is only
available in the 64-bit x86-64 architecture, not in 32-bit x86. Modify
pg_comp_crc32c_sse42 so that it only uses _mm_crc32_u64 on x86-64. With
these changes, the SSE accelerated CRC-32C implementation can also be used
on 32-bit x86 systems.
This also fixes the 32-bit MSVC build.1 parent b73e7a0 commit 936546d
3 files changed
+41
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
480 | 484 | | |
481 | 485 | | |
482 | 486 | | |
483 | 487 | | |
484 | | - | |
| 488 | + | |
485 | 489 | | |
486 | 490 | | |
487 | 491 | | |
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
492 | | - | |
| 496 | + | |
493 | 497 | | |
494 | 498 | | |
495 | 499 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14172 | 14172 | | |
14173 | 14173 | | |
14174 | 14174 | | |
14175 | | - | |
14176 | | - | |
| 14175 | + | |
| 14176 | + | |
14177 | 14177 | | |
14178 | 14178 | | |
14179 | 14179 | | |
| |||
14189 | 14189 | | |
14190 | 14190 | | |
14191 | 14191 | | |
14192 | | - | |
| 14192 | + | |
14193 | 14193 | | |
14194 | 14194 | | |
14195 | 14195 | | |
| |||
14212 | 14212 | | |
14213 | 14213 | | |
14214 | 14214 | | |
14215 | | - | |
14216 | | - | |
| 14215 | + | |
| 14216 | + | |
14217 | 14217 | | |
14218 | 14218 | | |
14219 | 14219 | | |
| |||
14229 | 14229 | | |
14230 | 14230 | | |
14231 | 14231 | | |
14232 | | - | |
| 14232 | + | |
14233 | 14233 | | |
14234 | 14234 | | |
14235 | 14235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | | - | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | | - | |
45 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
46 | 61 | | |
47 | | - | |
48 | | - | |
| 62 | + | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| |||
0 commit comments