Commit 7de2b81
committed
[LLVM][AArch64] Add native ct.select support for ARM64
This patch implements architecture-specific lowering for ct.select on AArch64
using CSEL (conditional select) instructions for constant-time selection.
Implementation details:
- Uses CSEL family of instructions for scalar integer types
- Uses FCSEL for floating-point types (F16, BF16, F32, F64)
- Post-RA MC lowering to convert pseudo-instructions to real CSEL/FCSEL
- Handles vector types appropriately
- Comprehensive test coverage for AArch64
The implementation includes:
- ISelLowering: Custom lowering to CTSELECT pseudo-instructions
- InstrInfo: Pseudo-instruction definitions and patterns
- MCInstLower: Post-RA lowering of pseudo-instructions to actual CSEL/FCSEL
- Proper handling of condition codes for constant-time guarantees1 parent 6ac8221 commit 7de2b81
File tree
6 files changed
+368
-110
lines changed- llvm
- lib/Target/AArch64
- test/CodeGen/AArch64
6 files changed
+368
-110
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
517 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
518 | 529 | | |
519 | 530 | | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
520 | 544 | | |
521 | 545 | | |
522 | 546 | | |
| |||
3328 | 3352 | | |
3329 | 3353 | | |
3330 | 3354 | | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
3331 | 3369 | | |
3332 | 3370 | | |
3333 | 3371 | | |
| |||
7590 | 7628 | | |
7591 | 7629 | | |
7592 | 7630 | | |
| 7631 | + | |
| 7632 | + | |
7593 | 7633 | | |
7594 | 7634 | | |
7595 | 7635 | | |
| |||
12149 | 12189 | | |
12150 | 12190 | | |
12151 | 12191 | | |
| 12192 | + | |
| 12193 | + | |
| 12194 | + | |
| 12195 | + | |
| 12196 | + | |
| 12197 | + | |
| 12198 | + | |
| 12199 | + | |
| 12200 | + | |
| 12201 | + | |
| 12202 | + | |
| 12203 | + | |
| 12204 | + | |
| 12205 | + | |
| 12206 | + | |
| 12207 | + | |
12152 | 12208 | | |
12153 | 12209 | | |
12154 | 12210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
205 | 213 | | |
206 | 214 | | |
207 | 215 | | |
| |||
684 | 692 | | |
685 | 693 | | |
686 | 694 | | |
| 695 | + | |
687 | 696 | | |
688 | 697 | | |
689 | 698 | | |
| |||
919 | 928 | | |
920 | 929 | | |
921 | 930 | | |
| 931 | + | |
| 932 | + | |
922 | 933 | | |
923 | 934 | | |
924 | 935 | | |
| |||
0 commit comments