Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/a-ztso-store-compat-seq-cst.c

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