Files
ftmemsim-valgrind/none/tests/ppc64/test_touch_tm.c
Carl Love aa85e04a41 Patch 4 and 5 of 7, improve PPC HW capabiltiy checking.
The patch was submitted by Will Schmidt  (will_schmidt@vnet.ibm.com).

Patches 4 and 5 need to be applied together.  Add convenience function
for processing hwcap entries. Add logic to check for HTM support in compiler.

Bugzilla 34979


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15423
2015-07-20 21:25:32 +00:00

26 lines
757 B
C

#include <stdio.h>
int main (void) {
#ifdef SUPPORTS_HTM
/* Just get the compiler to generate each of the TM instructions
* so we can verify that valgrind recognizes them.
* For now, only the tbegin instruction does anything in valgrind.
* The rest are just treated as NOPS.
*/
__builtin_tabort (0);
__builtin_tabortdc (0,0,0);
__builtin_tabortdci (0,0,0);
__builtin_tabortwc (0,0,0);
__builtin_tabortwci (0,0,0);
__builtin_tbegin (0);
__builtin_tend (0);
// __builtin_tcheck (0); tcheck not recognized by compiler
__builtin_trechkpt (); // not recognized by early HW
__builtin_treclaim (0); // not recognized by early HW
__builtin_tsr (0);
#else
printf ("No HTM support.");
#endif
return 0;
}