]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Power PC, add the two privileged Transactional Memory instructions.
authorCarl Love <cel@us.ibm.com>
Wed, 9 Oct 2013 17:56:34 +0000 (17:56 +0000)
committerCarl Love <cel@us.ibm.com>
Wed, 9 Oct 2013 17:56:34 +0000 (17:56 +0000)
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

none/tests/ppc32/Makefile.am
none/tests/ppc32/test_touch_tm.stderr.exp [new file with mode: 0644]
none/tests/ppc32/test_touch_tm.stdout.exp [new file with mode: 0644]
none/tests/ppc32/test_touch_tm.vgtest [new file with mode: 0644]
none/tests/ppc64/Makefile.am
none/tests/ppc64/test_touch_tm.c [new file with mode: 0644]
none/tests/ppc64/test_touch_tm.stderr.exp [new file with mode: 0644]
none/tests/ppc64/test_touch_tm.stdout.exp [new file with mode: 0644]
none/tests/ppc64/test_touch_tm.vgtest [new file with mode: 0644]

index dfd2d3fa82a5a3970b30f08c2785f35dd07e1535..4f581b6f0c3d6dc987601858223bb09ea3f50e8a 100644 (file)
@@ -42,7 +42,8 @@ EXTRA_DIST = \
        jm_fp_isa_2_07.stderr.exp jm_fp_isa_2_07.stdout.exp jm_fp_isa_2_07.vgtest \
        jm_int_isa_2_07.stderr.exp jm_int_isa_2_07.stdout.exp jm_int_isa_2_07.vgtest \
        test_isa_2_07_part2.stderr.exp test_isa_2_07_part2.stdout.exp test_isa_2_07_part2.vgtest \
-       test_tm.stderr.exp test_tm.stdout.exp test_tm.vgtest
+       test_tm.stderr.exp test_tm.stdout.exp test_tm.vgtest \
+       test_touch_tm.stderr.exp test_touch_tm.stdout.exp test_touch_tm.vgtest
 
 
 check_PROGRAMS = \
@@ -57,7 +58,8 @@ check_PROGRAMS = \
        test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
        test_isa_2_07_part1 \
        test_isa_2_07_part2 \
-       test_tm
+       test_tm \
+       test_touch_tm
 
 AM_CFLAGS    += @FLAG_M32@
 AM_CXXFLAGS  += @FLAG_M32@
@@ -131,3 +133,5 @@ test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(
 
 test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
                        @FLAG_M32@ $(BUILD_FLAGS_ISA_2_07)
+test_touch_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
+                       @FLAG_M32@ $(BUILD_FLAGS_ISA_2_07)
diff --git a/none/tests/ppc32/test_touch_tm.stderr.exp b/none/tests/ppc32/test_touch_tm.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/ppc32/test_touch_tm.stdout.exp b/none/tests/ppc32/test_touch_tm.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/none/tests/ppc32/test_touch_tm.vgtest b/none/tests/ppc32/test_touch_tm.vgtest
new file mode 100644 (file)
index 0000000..4806ccf
--- /dev/null
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_touch_tm
index 4607cdd1646ab558b4abdf919103b41d028122a1..93c6fe132249369d4c6c78c6d4eeeef7079434ab 100644 (file)
@@ -30,7 +30,8 @@ EXTRA_DIST = \
        jm_fp_isa_2_07.stderr.exp jm_fp_isa_2_07.stdout.exp jm_fp_isa_2_07.vgtest \
        jm_int_isa_2_07.stderr.exp jm_int_isa_2_07.stdout.exp jm_int_isa_2_07.vgtest \
        test_isa_2_07_part2.stderr.exp test_isa_2_07_part2.stdout.exp test_isa_2_07_part2.vgtest \
-       test_tm.stderr.exp test_tm.stdout.exp test_tm.vgtest
+       test_tm.stderr.exp test_tm.stdout.exp test_tm.vgtest \
+       test_touch_tm.stderr.exp test_touch_tm.stdout.exp test_touch_tm.vgtest
 
 check_PROGRAMS = \
        allexec \
@@ -38,7 +39,7 @@ check_PROGRAMS = \
        power6_mf_gpr test_isa_2_06_part1 test_isa_2_06_part2 \
        test_isa_2_06_part3 test_dfp1 test_dfp2 test_dfp3 test_dfp4 \
        test_dfp5 test_isa_2_07_part1 test_isa_2_07_part2 \
-       test_tm
+       test_tm test_touch_tm
 
 AM_CFLAGS    += @FLAG_M64@
 AM_CXXFLAGS  += @FLAG_M64@
@@ -110,3 +111,5 @@ test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(
 
 test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
                        @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07)
+test_touch_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
+                       @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07)
diff --git a/none/tests/ppc64/test_touch_tm.c b/none/tests/ppc64/test_touch_tm.c
new file mode 100644 (file)
index 0000000..9e40083
--- /dev/null
@@ -0,0 +1,23 @@
+#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;
+}
diff --git a/none/tests/ppc64/test_touch_tm.stderr.exp b/none/tests/ppc64/test_touch_tm.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/ppc64/test_touch_tm.stdout.exp b/none/tests/ppc64/test_touch_tm.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/none/tests/ppc64/test_touch_tm.vgtest b/none/tests/ppc64/test_touch_tm.vgtest
new file mode 100644 (file)
index 0000000..4806ccf
--- /dev/null
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_touch_tm