forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b03a27
committed
Use __attribute__((target(...))) for SSE4.2 CRC-32C support.
Presently, we check for compiler support for the requiredintrinsics both with and without the -msse4.2 compiler flag, andthen depending on the results of those checks, we pick which filesto compile with which flags. This is tedious and complicated, andit results in unsustainable coding patterns such as separate filesfor each portion of code that may need to be built with differentcompiler flags.This commit makes use of the newly-added support for__attribute__((target(...))) in the SSE4.2 CRC-32C code. Thissimplifies both the configure-time checks and the build scripts,and it allows us to place the functions that use the intrinsics infiles that we otherwise do not want to build with special CPUinstructions (although this commit refrains from doing so). Thisis also preparatory work for a proposed follow-up commit that willfurther optimize the CRC-32C code with AVX-512 instructions.While at it, this commit modifies meson's checks for SSE4.2 CRCsupport to be the same as autoconf's. meson was choosing whetherto use a runtime check based purely on whether -msse4.2 isrequired, while autoconf has long checked for the __SSE4_2__preprocessor symbol to decide. meson's previous approach seems towork just fine, but this change avoids needing to build multipletest programs and to keep track of whether to actually usepg_attribute_target().Ideally we'd use __attribute__((target(...))) for ARMv8 CRCsupport, too, but there's little point in doing so because untilclang 16, using the ARM intrinsics still requires special compilerflags. Perhaps we can re-evaluate this decision after some timehas passed.Author: Raghuveer DevulapalliDiscussion:https://postgr.es/m/PH8PR11MB8286BE735A463468415D46B5FB5C2%40PH8PR11MB8286.namprd11.prod.outlook.com1 parent6ba9892 commit4b03a27
File tree
7 files changed
+72
-102
lines changed- config
- src/port
7 files changed
+72
-102
lines changedLines changed: 17 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
605 | 605 |
| |
606 | 606 |
| |
607 | 607 |
| |
608 |
| - | |
609 |
| - | |
| 608 | + | |
610 | 609 |
| |
611 |
| - | |
612 |
| - | |
613 |
| - | |
614 |
| - | |
615 |
| - | |
616 |
| - | |
617 |
| - | |
618 |
| - | |
619 |
| - | |
620 |
| - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
621 | 625 |
| |
622 |
| - | |
623 |
| - | |
| 626 | + | |
624 | 627 |
| |
625 |
| - | |
626 | 628 |
| |
627 | 629 |
| |
628 | 630 |
| |
|
Lines changed: 29 additions & 64 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17364 | 17364 |
| |
17365 | 17365 |
| |
17366 | 17366 |
| |
17367 |
| - | |
17368 |
| - | |
17369 |
| - | |
17370 |
| - | |
17371 |
| - | |
17372 |
| - | |
| 17367 | + | |
| 17368 | + | |
| 17369 | + | |
17373 | 17370 |
| |
17374 | 17371 |
| |
17375 |
| - | |
17376 |
| - | |
17377 |
| - | |
17378 |
| - | |
17379 |
| - | |
17380 |
| - | |
17381 |
| - | |
17382 |
| - | |
17383 |
| - | |
17384 |
| - | |
17385 |
| - | |
17386 |
| - | |
17387 |
| - | |
17388 |
| - | |
17389 |
| - | |
17390 |
| - | |
17391 |
| - | |
17392 |
| - | |
17393 |
| - | |
17394 |
| - | |
17395 |
| - | |
17396 |
| - | |
17397 |
| - | |
17398 |
| - | |
17399 |
| - | |
17400 |
| - | |
17401 |
| - | |
17402 |
| - | |
17403 |
| - | |
17404 |
| - | |
17405 |
| - | |
17406 |
| - | |
17407 |
| - | |
17408 |
| - | |
17409 |
| - | |
17410 |
| - | |
17411 |
| - | |
17412 |
| - | |
17413 |
| - | |
17414 |
| - | |
17415 |
| - | |
17416 |
| - | |
| 17372 | + | |
17417 | 17373 |
| |
17418 | 17374 |
| |
| 17375 | + | |
| 17376 | + | |
| 17377 | + | |
| 17378 | + | |
| 17379 | + | |
| 17380 | + | |
| 17381 | + | |
| 17382 | + | |
| 17383 | + | |
| 17384 | + | |
| 17385 | + | |
17419 | 17386 |
| |
17420 | 17387 |
| |
17421 | 17388 |
| |
17422 |
| - | |
17423 |
| - | |
17424 |
| - | |
17425 |
| - | |
17426 |
| - | |
| 17389 | + | |
17427 | 17390 |
| |
17428 | 17391 |
| |
17429 | 17392 |
| |
17430 | 17393 |
| |
17431 | 17394 |
| |
17432 |
| - | |
| 17395 | + | |
17433 | 17396 |
| |
17434 |
| - | |
| 17397 | + | |
17435 | 17398 |
| |
17436 | 17399 |
| |
17437 | 17400 |
| |
17438 |
| - | |
17439 | 17401 |
| |
17440 |
| - | |
17441 |
| - | |
17442 |
| - | |
17443 |
| - | |
| 17402 | + | |
| 17403 | + | |
| 17404 | + | |
17444 | 17405 |
| |
17445 | 17406 |
| |
17446 | 17407 |
| |
17447 |
| - | |
17448 | 17408 |
| |
17449 | 17409 |
| |
17450 | 17410 |
| |
| |||
17647 | 17607 |
| |
17648 | 17608 |
| |
17649 | 17609 |
| |
17650 |
| - | |
17651 |
| - | |
17652 |
| - | |
| 17610 | + | |
| 17611 | + | |
| 17612 | + | |
17653 | 17613 |
| |
17654 | 17614 |
| |
17655 | 17615 |
| |
17656 | 17616 |
| |
17657 | 17617 |
| |
17658 | 17618 |
| |
| 17619 | + | |
| 17620 | + | |
| 17621 | + | |
| 17622 | + | |
| 17623 | + | |
17659 | 17624 |
| |
17660 | 17625 |
| |
17661 | 17626 |
| |
|
Lines changed: 9 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2068 | 2068 |
| |
2069 | 2069 |
| |
2070 | 2070 |
| |
2071 |
| - | |
2072 |
| - | |
2073 |
| - | |
2074 |
| - | |
2075 |
| - | |
2076 |
| - | |
2077 |
| - | |
| 2071 | + | |
2078 | 2072 |
| |
2079 | 2073 |
| |
2080 | 2074 |
| |
| |||
2111 | 2105 |
| |
2112 | 2106 |
| |
2113 | 2107 |
| |
2114 |
| - | |
2115 |
| - | |
2116 |
| - | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
2117 | 2111 |
| |
2118 | 2112 |
| |
2119 | 2113 |
| |
2120 | 2114 |
| |
2121 | 2115 |
| |
2122 | 2116 |
| |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
2123 | 2122 |
| |
2124 | 2123 |
| |
2125 | 2124 |
| |
|
Lines changed: 15 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2211 | 2211 |
| |
2212 | 2212 |
| |
2213 | 2213 |
| |
2214 |
| - | |
2215 |
| - | |
2216 |
| - | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2217 | 2217 |
| |
2218 | 2218 |
| |
2219 | 2219 |
| |
2220 | 2220 |
| |
2221 | 2221 |
| |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
2222 | 2227 |
| |
2223 | 2228 |
| |
2224 | 2229 |
| |
| |||
2234 | 2239 |
| |
2235 | 2240 |
| |
2236 | 2241 |
| |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
2237 | 2245 |
| |
2238 | 2246 |
| |
2239 | 2247 |
| |
| |||
2244 | 2252 |
| |
2245 | 2253 |
| |
2246 | 2254 |
| |
2247 |
| - | |
| 2255 | + | |
2248 | 2256 |
| |
| 2257 | + | |
| 2258 | + | |
2249 | 2259 |
| |
2250 | 2260 |
| |
2251 | 2261 |
| |
2252 |
| - | |
2253 |
| - | |
| 2262 | + | |
2254 | 2263 |
| |
2255 | 2264 |
| |
2256 |
| - | |
2257 | 2265 |
| |
2258 | 2266 |
| |
2259 | 2267 |
| |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
90 | 85 |
| |
91 | 86 |
| |
92 | 87 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
85 |
| - | |
| 85 | + | |
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
|
0 commit comments
Comments
(0)