Commit 1073b50
committed
RISC-V: Implement __builtin_thread_pointer
RISC-V has a dedicate register for thread pointer which is specified in psABI
doc, so we could support __builtin_thread_pointer in straightforward way.
Note: clang/llvm was supported __builtin_thread_pointer for RISC-V port
recently.
- https://reviews.llvm.org/rGaabc24acf0d5f8677bd22fe9c108581e07c3e180
gcc/ChangeLog:
* config/riscv/riscv.md (get_thread_pointer<mode>): New.
(TP_REGNUM): Ditto.
* doc/extend.texi (Target Builtins): Add RISC-V built-in section.
Document __builtin_thread_pointer.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/read-thread-pointer.c: New.1 parent 4c0d132 commit 1073b50
3 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
2515 | 2516 | | |
2516 | 2517 | | |
2517 | 2518 | | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
2518 | 2526 | | |
2519 | 2527 | | |
2520 | 2528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13859 | 13859 | | |
13860 | 13860 | | |
13861 | 13861 | | |
| 13862 | + | |
13862 | 13863 | | |
13863 | 13864 | | |
13864 | 13865 | | |
| |||
21471 | 21472 | | |
21472 | 21473 | | |
21473 | 21474 | | |
| 21475 | + | |
| 21476 | + | |
| 21477 | + | |
| 21478 | + | |
| 21479 | + | |
| 21480 | + | |
| 21481 | + | |
| 21482 | + | |
| 21483 | + | |
| 21484 | + | |
21474 | 21485 | | |
21475 | 21486 | | |
21476 | 21487 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments