mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-06 19:54:18 +00:00
The initial Transactional Memory instruction patch did not include the two privileged (OS) instructions treclaim and trechkpt. VEX commit 2784 added the support for these two instructions. This patch adds a touch test to make sure all of the POWER Transactional memory instrutions are recognized by Valgrind. All of the the Transactional Memory instructions, with the exception of tbegin, are treated as NOPs in the first implementation. The tbegin instruction causes the transaction to fail thus no additional Transactional Memory instructions on the successful transaction path would be executed in a real program. This test just makes sure each instruction is actually recognized by Valgrind. The patch if for Bugzilla 325751. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13630
24 lines
720 B
C
24 lines
720 B
C
#include <stdio.h>
|
|
|
|
int main (void) {
|
|
#ifdef HAS_ISA_2_07
|
|
/* 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);
|
|
#endif
|
|
return 0;
|
|
}
|