This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] S390: Improve comments for s390-tdbregs test case
- From: Andreas Arnez <arnez at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 19 Jan 2018 13:15:00 -0000
- Subject: [binutils-gdb] S390: Improve comments for s390-tdbregs test case
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d6ad07fdef94777bb512f072361706bcc743d51c
commit d6ad07fdef94777bb512f072361706bcc743d51c
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
Date: Fri Jan 19 14:14:07 2018 +0100
S390: Improve comments for s390-tdbregs test case
This adds more explanation as to why the test case must be compiled with
the -msoft-float option. It also documents the my_tbegin and my_tend
functions.
gdb/testsuite/ChangeLog:
* gdb.arch/s390-tdbregs.c (my_tbegin): Add comment documenting the
function.
(my_tend): Likewise.
* gdb.arch/s390-tdbregs.exp: Enhance comment; explain the
rationale of avoiding FP- and vector instructions.
Diff:
---
gdb/testsuite/ChangeLog | 8 ++++++++
gdb/testsuite/gdb.arch/s390-tdbregs.c | 9 +++++++++
gdb/testsuite/gdb.arch/s390-tdbregs.exp | 6 ++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index f3d31e7..d510b79 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2018-01-19 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ * gdb.arch/s390-tdbregs.c (my_tbegin): Add comment documenting the
+ function.
+ (my_tend): Likewise.
+ * gdb.arch/s390-tdbregs.exp: Enhance comment; explain the
+ rationale of avoiding FP- and vector instructions.
+
2018-01-19 Ruslan Kabatsayev <b7.10110111@gmail.com>
* gdb.arch/powerpc-d128-regs.exp: Replace expected "\[\t\]*" from
diff --git a/gdb/testsuite/gdb.arch/s390-tdbregs.c b/gdb/testsuite/gdb.arch/s390-tdbregs.c
index 2c768bb..57365ae 100644
--- a/gdb/testsuite/gdb.arch/s390-tdbregs.c
+++ b/gdb/testsuite/gdb.arch/s390-tdbregs.c
@@ -17,6 +17,13 @@
#include <stdio.h>
+/* Start a transaction. To avoid the need for FPR save/restore, assume
+ that no FP- or vector registers are modified within the transaction.
+ Thus invoke TBEGIN with the "allow floating-point operation" flag set
+ to zero, which forces a transaction abort when hitting an FP- or vector
+ instruction. Also assume that TBEGIN will eventually succeed, so just
+ retry indefinitely. */
+
static void
my_tbegin ()
{
@@ -28,6 +35,8 @@ my_tbegin ()
: "cc", "memory" );
}
+/* End a transaction. */
+
static void
my_tend ()
{
diff --git a/gdb/testsuite/gdb.arch/s390-tdbregs.exp b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
index 47d9d38..e454feb 100644
--- a/gdb/testsuite/gdb.arch/s390-tdbregs.exp
+++ b/gdb/testsuite/gdb.arch/s390-tdbregs.exp
@@ -26,8 +26,10 @@ if { ![istarget s390-*-*] && ![istarget s390x-*-* ] } {
standard_testfile .c
-# Use soft float, so the compiler doesn't use floating-point or vector
-# instructions.
+# The test case assumes that no FP- or vector instructions occur within
+# the transaction. Thus tell the compiler to use soft float, so it
+# doesn't emit them. Some GCC versions may otherwise do so, and an
+# endless loop would result.
if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list "debug" "additional_flags=-msoft-float"]] } {
return -1