annotate gcc/testsuite/brig.dg/test/gimple/atomics.hsail @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 module &module:1:0:$full:$large:$default;
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* Test for atomic instructions. */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 /* { dg-do compile } */
kono
parents:
diff changeset
6 /* { dg-options "-fdump-tree-original" } */
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 prog kernel &Kernel(kernarg_u64 %input_ptr, kernarg_u64 %output_ptr)
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 ld_kernarg_u64 $d0, [%input_ptr];
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 atomic_ld_global_rlx_system_b32 $s0, [$d0];
kono
parents:
diff changeset
13 atomic_add_global_rlx_system_u32 $s1, [$d0 + 4], $s0;
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 ld_kernarg_u64 $d0, [%output_ptr];
kono
parents:
diff changeset
16 atomicnoret_st_global_rlx_system_b32 [$d0], $s2;
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 atomicnoret_min_global_rlx_system_u32 [$d0 + 4], $s1;
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 ret;
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* The atomic loads are implemented by casting to an atomic pointer. */
kono
parents:
diff changeset
24 /* { dg-final { scan-tree-dump "s0 = VIEW_CONVERT_EXPR<unsigned int>\\\(\\\*\\\(atomic unsigned int \\\*\\\)" "original"} } */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* The atomic add should call a gcc builtin. */
kono
parents:
diff changeset
27 /* { dg-final { scan-tree-dump "= __sync_fetch_and_add_4 \\\(" "original"} } */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* The atomic stores are implemented by casting to an atomic pointer. */
kono
parents:
diff changeset
30 /* { dg-final { scan-tree-dump "\\\*\\\(atomic unsigned int \\\*\\\) d0 = s2;" "original"} } */
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 /* The atomic min is implemented by a custom builtin. */
kono
parents:
diff changeset
33 /* { dg-final { scan-tree-dump "builtin_out.\[0-9\]+ = __builtin___hsail_atomic_min_u32 \\\(" "original"} } */