|
From: <sv...@va...> - 2013-10-09 17:56:43
|
Author: carll
Date: Wed Oct 9 17:56:34 2013
New Revision: 13630
Log:
Power PC, add the two privileged Transactional Memory instructions.
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.
Added:
trunk/none/tests/ppc32/test_touch_tm.stderr.exp
trunk/none/tests/ppc32/test_touch_tm.stdout.exp
trunk/none/tests/ppc32/test_touch_tm.vgtest
trunk/none/tests/ppc64/test_touch_tm.c
trunk/none/tests/ppc64/test_touch_tm.stderr.exp
trunk/none/tests/ppc64/test_touch_tm.stdout.exp
trunk/none/tests/ppc64/test_touch_tm.vgtest
Modified:
trunk/none/tests/ppc32/Makefile.am
trunk/none/tests/ppc64/Makefile.am
Modified: trunk/none/tests/ppc32/Makefile.am
==============================================================================
--- trunk/none/tests/ppc32/Makefile.am (original)
+++ trunk/none/tests/ppc32/Makefile.am Wed Oct 9 17:56:34 2013
@@ -42,7 +42,8 @@
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 @@
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_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)
Added: trunk/none/tests/ppc32/test_touch_tm.stderr.exp
==============================================================================
--- trunk/none/tests/ppc32/test_touch_tm.stderr.exp (added)
+++ trunk/none/tests/ppc32/test_touch_tm.stderr.exp Wed Oct 9 17:56:34 2013
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc32/test_touch_tm.stdout.exp
==============================================================================
(empty)
Added: trunk/none/tests/ppc32/test_touch_tm.vgtest
==============================================================================
--- trunk/none/tests/ppc32/test_touch_tm.vgtest (added)
+++ trunk/none/tests/ppc32/test_touch_tm.vgtest Wed Oct 9 17:56:34 2013
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_touch_tm
Modified: trunk/none/tests/ppc64/Makefile.am
==============================================================================
--- trunk/none/tests/ppc64/Makefile.am (original)
+++ trunk/none/tests/ppc64/Makefile.am Wed Oct 9 17:56:34 2013
@@ -30,7 +30,8 @@
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 @@
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_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)
Added: trunk/none/tests/ppc64/test_touch_tm.c
==============================================================================
--- trunk/none/tests/ppc64/test_touch_tm.c (added)
+++ trunk/none/tests/ppc64/test_touch_tm.c Wed Oct 9 17:56:34 2013
@@ -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;
+}
Added: trunk/none/tests/ppc64/test_touch_tm.stderr.exp
==============================================================================
--- trunk/none/tests/ppc64/test_touch_tm.stderr.exp (added)
+++ trunk/none/tests/ppc64/test_touch_tm.stderr.exp Wed Oct 9 17:56:34 2013
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc64/test_touch_tm.stdout.exp
==============================================================================
(empty)
Added: trunk/none/tests/ppc64/test_touch_tm.vgtest
==============================================================================
--- trunk/none/tests/ppc64/test_touch_tm.vgtest (added)
+++ trunk/none/tests/ppc64/test_touch_tm.vgtest Wed Oct 9 17:56:34 2013
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_touch_tm
|