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