Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/a-rvwmo-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-remove-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 ** fence\trw,w
13 ** s[wd]\t[atx][0-9]+,0\(a0\)
14 ** fence\trw,rw
15 ** ret
16 */
17 void atomic_store_long_seq_cst (long* bar, long* baz)
18 {
19 __atomic_store(bar, baz, __ATOMIC_SEQ_CST);
20 }
21
22 /*
23 ** atomic_store_int_seq_cst:
24 ** lw\t[atx][0-9]+,0\(a1\)
25 ** fence\trw,w
26 ** sw\t[atx][0-9]+,0\(a0\)
27 ** fence\trw,rw
28 ** ret
29 */
30 void atomic_store_int_seq_cst (int* bar, int* baz)
31 {
32 __atomic_store(bar, baz, __ATOMIC_SEQ_CST);
33 }
34
35 /*
36 ** atomic_store_short_seq_cst:
37 ** lhu\t[atx][0-9]+,0\(a1\)
38 ** fence\trw,w
39 ** sh\t[atx][0-9]+,0\(a0\)
40 ** fence\trw,rw
41 ** ret
42 */
43 void atomic_store_short_seq_cst (short* bar, short* baz)
44 {
45 __atomic_store(bar, baz, __ATOMIC_SEQ_CST);
46 }
47
48 /*
49 ** atomic_store_char_seq_cst:
50 ** lbu\t[atx][0-9]+,0\(a1\)
51 ** fence\trw,w
52 ** sb\t[atx][0-9]+,0\(a0\)
53 ** fence\trw,rw
54 ** ret
55 */
56 void atomic_store_char_seq_cst (char* bar, char* baz)
57 {
58 __atomic_store(bar, baz, __ATOMIC_SEQ_CST);
59 }
60
61 /*
62 ** atomic_store_bool_seq_cst:
63 ** lbu\t[atx][0-9]+,0\(a1\)
64 ** fence\trw,w
65 ** sb\t[atx][0-9]+,0\(a0\)
66 ** fence\trw,rw
67 ** ret
68 */
69 void atomic_store_bool_seq_cst (_Bool* bar, _Bool* baz)
70 {
71 __atomic_store(bar, baz, __ATOMIC_SEQ_CST);
72 }