|
From: <sv...@va...> - 2013-10-02 16:29:05
|
Author: carll
Date: Wed Oct 2 16:28:57 2013
New Revision: 13607
Log:
IBM POWER PC, Add the Transactional Memory test case
The test case for the transaction memory instructions executes the
failure path when run under valgrind. This is since the initial
Transaction Memory implemnetation is to simply fail the TBEGIN instruction
forcing the execution flow to take the failure path. When the
test case is executed on the real hardware, the success path will
be taken. Only the TBEGIN instruction actually does anything. All other
transactional memory instructions are NOPs since only failure path is executed
and it assumed to not have any transactional memory instructions on it.
Signed-off-by: Carl Love <ce...@us...>
VEX commit revision 2780
Bugzilla 323803
Added:
trunk/none/tests/ppc32/test_tm.c (with props)
trunk/none/tests/ppc32/test_tm.stderr.exp
trunk/none/tests/ppc32/test_tm.stdout.exp
trunk/none/tests/ppc32/test_tm.vgtest
trunk/none/tests/ppc64/test_tm.c
trunk/none/tests/ppc64/test_tm.stderr.exp
trunk/none/tests/ppc64/test_tm.stdout.exp
trunk/none/tests/ppc64/test_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 2 16:28:57 2013
@@ -41,7 +41,8 @@
jm_vec_isa_2_07.stderr.exp jm_vec_isa_2_07.stdout.exp jm_vec_isa_2_07.vgtest \
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_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
check_PROGRAMS = \
@@ -55,8 +56,8 @@
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_isa_2_07_part2 \
+ test_tm
AM_CFLAGS += @FLAG_M32@
AM_CXXFLAGS += @FLAG_M32@
@@ -127,3 +128,6 @@
test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
@FLAG_M32@ $(BUILD_FLAGS_ISA_2_07)
+
+test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mhtm -mregnames $(ISA_2_07_FLAG) \
+ @FLAG_M32@ $(BUILD_FLAGS_ISA_2_07)
Added: trunk/none/tests/ppc32/test_tm.c
==============================================================================
--- trunk/none/tests/ppc32/test_tm.c (added)
+++ trunk/none/tests/ppc32/test_tm.c Wed Oct 2 16:28:57 2013
@@ -0,0 +1 @@
+link ../ppc64/test_tm.c
\ No newline at end of file
Added: trunk/none/tests/ppc32/test_tm.stderr.exp
==============================================================================
--- trunk/none/tests/ppc32/test_tm.stderr.exp (added)
+++ trunk/none/tests/ppc32/test_tm.stderr.exp Wed Oct 2 16:28:57 2013
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc32/test_tm.stdout.exp
==============================================================================
--- trunk/none/tests/ppc32/test_tm.stdout.exp (added)
+++ trunk/none/tests/ppc32/test_tm.stdout.exp Wed Oct 2 16:28:57 2013
@@ -0,0 +1 @@
+ret = 20, expected = 10
Added: trunk/none/tests/ppc32/test_tm.vgtest
==============================================================================
--- trunk/none/tests/ppc32/test_tm.vgtest (added)
+++ trunk/none/tests/ppc32/test_tm.vgtest Wed Oct 2 16:28:57 2013
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_tm
Modified: trunk/none/tests/ppc64/Makefile.am
==============================================================================
--- trunk/none/tests/ppc64/Makefile.am (original)
+++ trunk/none/tests/ppc64/Makefile.am Wed Oct 2 16:28:57 2013
@@ -29,14 +29,16 @@
jm_vec_isa_2_07.stderr.exp jm_vec_isa_2_07.stdout.exp jm_vec_isa_2_07.vgtest \
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_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
check_PROGRAMS = \
allexec \
jm-insns lsw round std_reg_imm twi_tdi tw_td power6_bcmp \
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_dfp5 test_isa_2_07_part1 test_isa_2_07_part2 \
+ test_tm
AM_CFLAGS += @FLAG_M64@
AM_CXXFLAGS += @FLAG_M64@
@@ -105,3 +107,6 @@
test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \
@FLAG_M64@ $(BUILD_FLAGS_ISA_2_07)
+
+test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mhtm -mregnames $(ISA_2_07_FLAG) \
+ @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07)
Added: trunk/none/tests/ppc64/test_tm.c
==============================================================================
--- trunk/none/tests/ppc64/test_tm.c (added)
+++ trunk/none/tests/ppc64/test_tm.c Wed Oct 2 16:28:57 2013
@@ -0,0 +1,19 @@
+#include <stdio.h>
+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;
+}
+
+int main (void) {
+ int ret;
+ ret = htm_begin (10, 20);
+ printf ("ret = %d, expected = 10\n", ret);
+ return 0;
+}
Added: trunk/none/tests/ppc64/test_tm.stderr.exp
==============================================================================
--- trunk/none/tests/ppc64/test_tm.stderr.exp (added)
+++ trunk/none/tests/ppc64/test_tm.stderr.exp Wed Oct 2 16:28:57 2013
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/ppc64/test_tm.stdout.exp
==============================================================================
--- trunk/none/tests/ppc64/test_tm.stdout.exp (added)
+++ trunk/none/tests/ppc64/test_tm.stdout.exp Wed Oct 2 16:28:57 2013
@@ -0,0 +1 @@
+ret = 20, expected = 10
Added: trunk/none/tests/ppc64/test_tm.vgtest
==============================================================================
--- trunk/none/tests/ppc64/test_tm.vgtest (added)
+++ trunk/none/tests/ppc64/test_tm.vgtest Wed Oct 2 16:28:57 2013
@@ -0,0 +1,2 @@
+prereq: ../../../tests/check_isa-2_07_cap
+prog: test_tm
|