From patchwork Tue Oct 8 09:24:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 34864 Received: (qmail 58876 invoked by alias); 8 Oct 2019 09:25:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 58636 invoked by uid 89); 8 Oct 2019 09:25:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Oct 2019 09:25:11 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x9897l7e096883 for ; Tue, 8 Oct 2019 05:25:07 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vgnxqca74-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 08 Oct 2019 05:25:07 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Oct 2019 10:25:05 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 8 Oct 2019 10:25:03 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x989P03u60293178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Oct 2019 09:25:00 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E30AB42042; Tue, 8 Oct 2019 09:24:59 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BF8B142045; Tue, 8 Oct 2019 09:24:59 +0000 (GMT) Received: from oc0404454431.ibm.com (unknown [9.152.222.48]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 8 Oct 2019 09:24:59 +0000 (GMT) From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Ulrich Weigand Subject: [PATCH] s390: Add record/replay support for arch13 instructions Date: Tue, 08 Oct 2019 11:24:56 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 x-cbid: 19100809-0028-0000-0000-000003A80267 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19100809-0029-0000-0000-0000246A026A Message-Id: Enable recording most of the new "arch13" instructions on z/Architecture targets, except for the specialized-function-assist instructions: SORTL - sort lists DFLTCC - deflate conversion call KDSA - compute digital signature authentication gdb/ChangeLog: * s390-tdep.c (390_process_record): Handle new arch13 instructions except SORTL, DFLTCC, and KDSA. --- gdb/s390-tdep.c | 55 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 463c0a0bd7..e7f1215e1a 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -4134,6 +4134,7 @@ ex: case 0xb998: /* ALCR - add logical with carry */ case 0xb999: /* SLBR - subtract logical with borrow */ case 0xb9f4: /* NRK - and */ + case 0xb9f5: /* NCRK - and with complement */ case 0xb9f6: /* ORK - or */ case 0xb9f7: /* XRK - xor */ case 0xb9f8: /* ARK - add */ @@ -4166,20 +4167,32 @@ ex: case 0xb919: /* SGFR - subtract */ case 0xb91a: /* ALGFR - add logical */ case 0xb91b: /* SLGFR - subtract logical */ + case 0xb964: /* NNGRK - and 64 bit */ + case 0xb965: /* OCGRK - or with complement 64 bit */ + case 0xb966: /* NOGRK - or 64 bit */ + case 0xb967: /* NXGRK - not exclusive or 64 bit */ + case 0xb974: /* NNRK - and 32 bit */ + case 0xb975: /* OCRK - or with complement 32 bit */ + case 0xb976: /* NORK - or 32 bit */ + case 0xb977: /* NXRK - not exclusive or 32 bit */ case 0xb980: /* NGR - and */ case 0xb981: /* OGR - or */ case 0xb982: /* XGR - xor */ case 0xb988: /* ALCGR - add logical with carry */ case 0xb989: /* SLBGR - subtract logical with borrow */ + case 0xb9c0: /* SELFHR - select high */ case 0xb9e1: /* POPCNT - population count */ case 0xb9e4: /* NGRK - and */ + case 0xb9e5: /* NCGRK - and with complement */ case 0xb9e6: /* OGRK - or */ case 0xb9e7: /* XGRK - xor */ case 0xb9e8: /* AGRK - add */ case 0xb9e9: /* SGRK - subtract */ case 0xb9ea: /* ALGRK - add logical */ + case 0xb9e3: /* SELGR - select 64 bit */ case 0xb9eb: /* SLGRK - subtract logical */ case 0xb9ed: /* MSGRKC - multiply single 64x64 -> 64 */ + case 0xb9f0: /* SELR - select 32 bit */ case 0xb9fd: /* MSRKC - multiply single 32x32 -> 32 */ /* 64-bit gpr destination + flags */ if (s390_record_gpr_g (gdbarch, regcache, inib[6])) @@ -4555,7 +4568,13 @@ ex: return -1; break; - /* 0xb932-0xb93b undefined */ + /* 0xb932-0xb937 undefined */ + + /* 0xb938 unsupported: SORTL - sort lists */ + /* 0xb939 unsupported: DFLTCC - deflate conversion call */ + /* 0xb93a unsupported: KDSA - compute dig. signature auth. */ + + /* 0xb93b undefined */ case 0xb93c: /* PPNO - perform pseudorandom number operation [partial] */ regcache_raw_read_unsigned (regcache, S390_R1_REGNUM, &tmp); @@ -5485,6 +5504,13 @@ ex: /* 0xe3ce undefined */ /* 0xe3d0-0xe3ff undefined */ + case 0xe601: /* VLEBRH - vector load byte reversed element */ + case 0xe602: /* VLEBRG - vector load byte reversed element */ + case 0xe603: /* VLEBRF - vector load byte reversed element */ + case 0xe604: /* VLLEBRZ - vector load byte rev. el. and zero */ + case 0xe605: /* VLBRREP - vector load byte rev. el. and replicate */ + case 0xe606: /* VLBR - vector load byte reversed elements */ + case 0xe607: /* VLER - vector load elements reversed */ case 0xe634: /* VPKZ - vector pack zoned */ case 0xe635: /* VLRL - vector load rightmost with immed. length */ case 0xe637: /* VLRLR - vector load rightmost with length */ @@ -5547,6 +5573,9 @@ ex: case 0xe77f: /* VSRAB - vector shift right arithmetic by byte */ case 0xe784: /* VPDI - vector permute doubleword immediate */ case 0xe785: /* VBPERM - vector bit permute */ + case 0xe786: /* VSLD - vector shift left double by bit */ + case 0xe787: /* VSRD - vector shift right double by bit */ + case 0xe78b: /* VSTRS - vector string search */ case 0xe78c: /* VPERM - vector permute */ case 0xe78d: /* VSEL - vector select */ case 0xe78e: /* VFMS - vector fp multiply and subtract */ @@ -5575,10 +5604,10 @@ ex: case 0xe7bc: /* VGFMA - vector Galois field multiply sum and accumulate */ case 0xe7bd: /* VSBCBI - vector subtract with borrow compute borrow indication */ case 0xe7bf: /* VSBI - vector subtract with borrow indication */ - case 0xe7c0: /* VCLGD - vector convert to logical 64-bit */ - case 0xe7c1: /* VCDLG - vector convert from logical 64-bit */ - case 0xe7c2: /* VCGD - vector convert to fixed 64-bit */ - case 0xe7c3: /* VCDG - vector convert from fixed 64-bit */ + case 0xe7c0: /* VCLFP - vector fp convert to logical */ + case 0xe7c1: /* VCFPL - vector fp convert from logical */ + case 0xe7c2: /* VCSFP - vector fp convert to fixed */ + case 0xe7c3: /* VCFPS - vector fp convert from fixed */ case 0xe7c4: /* VLDE/VFLL - vector fp load lengthened */ case 0xe7c5: /* VLED/VFLR - vector fp load rounded */ case 0xe7c7: /* VFI - vector load fp integer */ @@ -5629,6 +5658,7 @@ ex: return -1; break; + case 0xe609: /* VSTEBRH - vector store byte reversed element */ case 0xe709: /* VSTEH - vector store element */ oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); if (record_full_arch_list_add_mem (oaddr, 2)) @@ -5637,6 +5667,7 @@ ex: return -1; break; + case 0xe60a: /* VSTEBRG - vector store byte reversed element */ case 0xe70a: /* VSTEG - vector store element */ oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); if (record_full_arch_list_add_mem (oaddr, 8)) @@ -5645,6 +5676,7 @@ ex: return -1; break; + case 0xe60b: /* VSTEBRF - vector store byte reversed element */ case 0xe70b: /* VSTEF - vector store element */ oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); if (record_full_arch_list_add_mem (oaddr, 4)) @@ -5655,6 +5687,8 @@ ex: /* 0xe70c-0xe70d undefined */ + case 0xe60e: /* VSTBR - vector store byte reversed elements */ + case 0xe60f: /* VSTER - vector store elements reversed */ case 0xe70e: /* VST - vector store */ oaddr = s390_record_calc_disp (gdbarch, regcache, inib[3], insn[1], 0); if (record_full_arch_list_add_mem (oaddr, 16)) @@ -6234,7 +6268,16 @@ ex: /* SSE/SIL-format instruction */ switch (insn[0]) { - /* 0xe500-0xe543 undefined, privileged, or unsupported */ + /* 0xe500-0xe509 undefined, privileged, or unsupported */ + + case 0xe50a: /* MVCRL - move right to left */ + regcache_raw_read_unsigned (regcache, S390_R0_REGNUM, &tmp); + oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0); + if (record_full_arch_list_add_mem (oaddr, (tmp & 0xff) + 1)) + return -1; + break; + + /* 0xe50b-0xe543 undefined, privileged, or unsupported */ case 0xe544: /* MVHHI - move */ oaddr = s390_record_calc_disp (gdbarch, regcache, 0, insn[1], 0);