From: Jens Remus Date: Wed, 11 Dec 2024 08:58:35 +0000 (+0100) Subject: gdb: s390: Correct record/replay of may/mayr insn X-Git-Tag: gdb-16-branchpoint~134 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d76ab5b0579e10466988ec0633536e3df8fdd77e;p=thirdparty%2Fbinutils-gdb.git gdb: s390: Correct record/replay of may/mayr insn 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 --- diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index be176f07c6f..d4b9a246880 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -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]))