S390: Improve comments for s390-tdbregs test case
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 19 Jan 2018 13:14:07 +0000 (14:14 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 19 Jan 2018 13:14:07 +0000 (14:14 +0100)
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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/s390-tdbregs.c
gdb/testsuite/gdb.arch/s390-tdbregs.exp

index f3d31e70843b3c468e6245c8d73746d38d888192..d510b794a954c4740485d3730d9b633a5492826f 100644 (file)
@@ -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
index 2c768bb169ee84f7066d3615dcbb8875772cd40a..57365aee1b01df01ac4a07627762784138c1d633 100644 (file)
 
 #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 ()
 {
index 47d9d380cac13fc33723835fd2a100344a504a37..e454feb9d94971dc5809cbe8da30bcfd34eada85 100644 (file)
@@ -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
This page took 0.035882 seconds and 4 git commands to generate.