mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-10 21:47:06 +00:00
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
26 lines
424 B
C
26 lines
424 B
C
#include <stdio.h>
|
|
#ifdef SUPPORTS_HTM
|
|
int __attribute__ ((noinline)) htm_begin (int r3, int r4)
|
|
{
|
|
int ret;
|
|
|
|
if (__builtin_tbegin (0)) {
|
|
ret = r3;
|
|
__builtin_tend (0);
|
|
} else {
|
|
ret = r4;
|
|
} return ret;
|
|
}
|
|
#endif
|
|
|
|
int main (void) {
|
|
#ifdef SUPPORTS_HTM
|
|
int ret;
|
|
ret = htm_begin (10, 20);
|
|
printf ("ret = %d, expected = 10\n", ret);
|
|
#else
|
|
printf ("No HTM support.");
|
|
#endif
|
|
return 0;
|
|
}
|