Debian Codegraph @

gcc/testsuite/gcc.target/riscv/amo/zabha-ztso-amo-add-short.c

raw
1 /* Verify that atomic op mappings match the PSABI doc's recommended mapping. */
2 /* { dg-do compile } */
3 /* { dg-options "-O3" } */
4 /* { dg-add-options riscv_ztso } */
5 /* { dg-add-options riscv_zabha } */
6 /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */
7 /* { dg-final { check-function-bodies "**" "" } } */
8
9 /*
10 ** atomic_add_fetch_short_relaxed:
11 ** amoadd\.h\tzero,a1,0\(a0\)
12 ** ret
13 */
14 void atomic_add_fetch_short_relaxed (short* bar, short baz)
15 {
16 __atomic_add_fetch(bar, baz, __ATOMIC_RELAXED);
17 }
18
19 /*
20 ** atomic_add_fetch_short_acquire:
21 ** amoadd\.h\tzero,a1,0\(a0\)
22 ** ret
23 */
24 void atomic_add_fetch_short_acquire (short* bar, short baz)
25 {
26 __atomic_add_fetch(bar, baz, __ATOMIC_ACQUIRE);
27 }
28
29 /*
30 ** atomic_add_fetch_short_release:
31 ** amoadd\.h\tzero,a1,0\(a0\)
32 ** ret
33 */
34 void atomic_add_fetch_short_release (short* bar, short baz)
35 {
36 __atomic_add_fetch(bar, baz, __ATOMIC_RELEASE);
37 }
38
39 /*
40 ** atomic_add_fetch_short_acq_rel:
41 ** amoadd\.h\tzero,a1,0\(a0\)
42 ** ret
43 */
44 void atomic_add_fetch_short_acq_rel (short* bar, short baz)
45 {
46 __atomic_add_fetch(bar, baz, __ATOMIC_ACQ_REL);
47 }
48
49 /*
50 ** atomic_add_fetch_short_seq_cst:
51 ** amoadd\.h\tzero,a1,0\(a0\)
52 ** ret
53 */
54 void atomic_add_fetch_short_seq_cst (short* bar, short baz)
55 {
56 __atomic_add_fetch(bar, baz, __ATOMIC_SEQ_CST);
57 }