1 /* This checks the availability of the low-level builtins introduced
2 for transactional execution. */
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -march=zEC12 -mzarch" } */
12 struct __htm_tdb global_tdb
;
15 foo (struct __htm_tdb
* tdb
, int reg
, int *mem
, uint64_t *mem64
)
21 cc
= __builtin_tbegin (0);
22 cc
= __builtin_tbegin (tdb
);
23 cc
= __builtin_tbegin (&global_tdb
);
25 cc
= __builtin_tbegin_nofloat (0);
26 cc
= __builtin_tbegin_nofloat (&global_tdb
);
28 cc
= __builtin_tbegin_retry (0, 42);
29 cc
= __builtin_tbegin_retry (0, reg
);
30 cc
= __builtin_tbegin_retry (0, *mem
);
31 cc
= __builtin_tbegin_retry (0, global
);
32 cc
= __builtin_tbegin_retry (tdb
, 42);
33 cc
= __builtin_tbegin_retry (&global_tdb
, 42);
35 cc
= __builtin_tbegin_retry_nofloat (0, 42);
36 cc
= __builtin_tbegin_retry_nofloat (0, reg
);
37 cc
= __builtin_tbegin_retry_nofloat (0, *mem
);
38 cc
= __builtin_tbegin_retry_nofloat (0, global
);
39 cc
= __builtin_tbegin_retry_nofloat (&global_tdb
, 42);
43 n
= __builtin_tx_nesting_depth();
45 __builtin_non_tx_store(&g
, 23);
46 __builtin_non_tx_store(mem64
, 23);
47 __builtin_non_tx_store(&g
, reg
);
48 __builtin_non_tx_store(&g
, *mem
);
49 __builtin_non_tx_store(&g
, global
);
51 __builtin_tabort (42 + 255);
52 __builtin_tabort (reg
);
53 /* { dg-final { scan-assembler-times "tabort\t255" 1 } } */
54 __builtin_tabort (reg
+ 255);
55 __builtin_tabort (*mem
);
56 __builtin_tabort (global
);
57 /* Here global + 255 gets reloaded into a reg. Better would be to
58 just reload global or *mem and get the +255 for free as address
60 __builtin_tabort (*mem
+ 255);
61 __builtin_tabort (global
+ 255);
65 __builtin_tx_assist (23);
66 __builtin_tx_assist (reg
);
67 __builtin_tx_assist (*mem
);
68 __builtin_tx_assist (global
);
71 /* Make sure the tdb NULL argument ends up as immediate value in the
73 /* { dg-final { scan-assembler-times "tbegin\t0," 10 } } */