]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: s390: Correct record/replay of may/mayr insn
authorJens Remus <jremus@linux.ibm.com>
Wed, 11 Dec 2024 08:58:35 +0000 (09:58 +0100)
committerJens Remus <jremus@linux.ibm.com>
Wed, 11 Dec 2024 08:58:35 +0000 (09:58 +0100)
The IBM z/Architecture Principles of Operation [1] specifies that the
R1 operand of the may and mayr instructions designates may designate
either the lower- or higher-numbered register of a floating-point-
register (FPR) pair.

[1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16,
     https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf

gdb/
* s390-tdep.c (s390_process_record): may/mayr operand R1 may
designate lower- or higher numbered register of FPR pair.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
gdb/s390-tdep.c

index be176f07c6f71c479dfcfc5993c3fc4a069ac1d8..d4b9a2468809c6cdfda15a89dedf652b4ac78518 100644 (file)
@@ -4014,6 +4014,13 @@ ex:
        /* 0xb330-0xb335 undefined */
 
        case 0xb33a: /* MAYR - multiply and add unnormalized */
+         /* float pair destination [RRD]; R1 may designate lower- or
+            higher-numbered register of pair */
+         if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + (inib[4] & 13)))
+           return -1;
+         if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + (inib[4] | 2)))
+           return -1;
+         break;
        case 0xb33b: /* MYR - multiply unnormalized */
          /* float pair destination [RRD] */
          if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + inib[4]))
@@ -6333,6 +6340,13 @@ ex:
        /* 0xed36 undefined */
 
        case 0xed3a: /* MAY - multiply and add unnormalized */
+         /* float pair destination [RXF]; R1 may designate lower- or
+            higher-numbered register of pair */
+         if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + (inib[8] & 13)))
+           return -1;
+         if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + (inib[8] | 2)))
+           return -1;
+         break;
        case 0xed3b: /* MY - multiply unnormalized */
          /* float pair destination [RXF] */
          if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + inib[8]))