lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <bits/wordsize.h> |
| 2 | |
| 3 | #ifdef __tilegx__ |
| 4 | # if __WORDSIZE == 64 |
| 5 | # define STACK_CHK_GUARD \ |
| 6 | ({ uintptr_t x; asm ("addi %0, tp, -16; ld %0, %0" : "=r" (x)); x; }) |
| 7 | # define POINTER_CHK_GUARD \ |
| 8 | ({ uintptr_t x; asm ("addi %0, tp, -24; ld %0, %0" : "=r" (x)); x; }) |
| 9 | # else |
| 10 | # define STACK_CHK_GUARD \ |
| 11 | ({ uintptr_t x; asm ("addi %0, tp, -8; ld4s %0, %0" : "=r" (x)); x; }) |
| 12 | # define POINTER_CHK_GUARD \ |
| 13 | ({ uintptr_t x; asm ("addi %0, tp, -12; ld4s %0, %0" : "=r" (x)); x; }) |
| 14 | # endif |
| 15 | #else |
| 16 | # define STACK_CHK_GUARD \ |
| 17 | ({ uintptr_t x; asm ("addi %0, tp, -8; lw %0, %0" : "=r" (x)); x; }) |
| 18 | # define POINTER_CHK_GUARD \ |
| 19 | ({ uintptr_t x; asm ("addi %0, tp, -12; lw %0, %0" : "=r" (x)); x; }) |
| 20 | #endif |