| 1 |
/* { dg-do compile } */ |
| 2 |
/* Verify that load mappings match the PSABI doc's recommended mapping. */ |
| 3 |
/* { dg-options "-O3" } */ |
| 4 |
/* { dg-remove-options riscv_ztso } */ |
| 5 |
/* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ |
| 6 |
/* { dg-final { check-function-bodies "**" "" } } */ |
| 7 |
|
| 8 |
/* |
| 9 |
** atomic_load_long_seq_cst: |
| 10 |
** fence\trw,rw |
| 11 |
** l[wd]\t[atx][0-9]+,0\(a0\) |
| 12 |
** fence\tr,rw |
| 13 |
** s[wd]\t[atx][0-9]+,0\(a1\) |
| 14 |
** ret |
| 15 |
*/ |
| 16 |
void atomic_load_long_seq_cst (long* bar, long* baz) |
| 17 |
{ |
| 18 |
__atomic_load(bar, baz, __ATOMIC_SEQ_CST); |
| 19 |
} |
| 20 |
|
| 21 |
/* |
| 22 |
** atomic_load_int_seq_cst: |
| 23 |
** fence\trw,rw |
| 24 |
** lw\t[atx][0-9]+,0\(a0\) |
| 25 |
** fence\tr,rw |
| 26 |
** sw\t[atx][0-9]+,0\(a1\) |
| 27 |
** ret |
| 28 |
*/ |
| 29 |
void atomic_load_int_seq_cst (int* bar, int* baz) |
| 30 |
{ |
| 31 |
__atomic_load(bar, baz, __ATOMIC_SEQ_CST); |
| 32 |
} |
| 33 |
|
| 34 |
/* |
| 35 |
** atomic_load_short_seq_cst: |
| 36 |
** fence\trw,rw |
| 37 |
** lh\t[atx][0-9]+,0\(a0\) |
| 38 |
** fence\tr,rw |
| 39 |
** sh\t[atx][0-9]+,0\(a1\) |
| 40 |
** ret |
| 41 |
*/ |
| 42 |
void atomic_load_short_seq_cst (short* bar, short* baz) |
| 43 |
{ |
| 44 |
__atomic_load(bar, baz, __ATOMIC_SEQ_CST); |
| 45 |
} |
| 46 |
|
| 47 |
/* |
| 48 |
** atomic_load_char_seq_cst: |
| 49 |
** fence\trw,rw |
| 50 |
** lb\t[atx][0-9]+,0\(a0\) |
| 51 |
** fence\tr,rw |
| 52 |
** sb\t[atx][0-9]+,0\(a1\) |
| 53 |
** ret |
| 54 |
*/ |
| 55 |
void atomic_load_char_seq_cst (char* bar, char* baz) |
| 56 |
{ |
| 57 |
__atomic_load(bar, baz, __ATOMIC_SEQ_CST); |
| 58 |
} |
| 59 |
|
| 60 |
/* |
| 61 |
** atomic_load_bool_seq_cst: |
| 62 |
** fence\trw,rw |
| 63 |
** lb\t[atx][0-9]+,0\(a0\) |
| 64 |
** fence\tr,rw |
| 65 |
** sb\t[atx][0-9]+,0\(a1\) |
| 66 |
** ret |
| 67 |
*/ |
| 68 |
void atomic_load_bool_seq_cst (_Bool* bar, _Bool* baz) |
| 69 |
{ |
| 70 |
__atomic_load(bar, baz, __ATOMIC_SEQ_CST); |
| 71 |
} |