From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id B7BBE385AC33 for ; Fri, 15 Dec 2023 14:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7BBE385AC33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B7BBE385AC33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650986; cv=none; b=KZjrtV1ybhG/XR+QVZVbxM2oaIZJlk/M9LOWHrGksjIpWZA5fFACzO51u/yonCVjhSx1S3HyXpzW8HMlftzOYD0t6y48E0p0sO46868vCBMd1anBSSSo1e9/dWtJ0K608XYwjbAifZ2ArGuGCKcoIeDXZLVq0gMe2VeF9sGz5k8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650986; c=relaxed/simple; bh=S9727BDZ2PI6cndEgCjmRK3JfwM+Pv6t7X4dxq0fApM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Q/IsrYbQ4xRGOJTtYEtVa4Ci7cJsDPcNjgVhAfLks38s8V79GdeNH9SWeiiak00FeOgTxMab5X3YjU0j7QLFoJ+SrEeoGLHhwxqcFeAwgkh2NNHju9m6L33iczdy97+lk2KHYahnYDSi4UDVsExlt9psLcIfc0AKhpQT28Y+QqQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEGsDL005831 for ; Fri, 15 Dec 2023 14:36:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=0h9pzGmrM8MMlbdIKiQp0BtxsI8vCqwYbRb8khb9lXE=; b=VsqEJW5epa0j4pX2qxlxxThdHcCmY8HP2cyBOGvoJ3ViU5NTM7ToWgsGsCAHnTk0TyP/ 1hjWrUvfGFr1O0eWEUCbG2ePm9J0oS85xJIkTZqO3TH/vQZfCDApT0ZYm3l+xl7bc3aK R5q7oMnN3/FhunWD9Xuzz/8J0g6CyoeYJaV3nsWghhYFi9+gv1QBfSGjpi7AiCVvGk08 Qej/VMB2YWz8fD47VSE4u76zv9avk2c1+8EcNIKWr2uLUdBtjQuMABF6ZJRDpTy5oy5K mXIw0gMXhBvikR3ApELgkHHSVYR/rWBiG7kf86+ZtzjQ3a812arkGBHDldPsmu+Ofego IA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0re1ggtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Dec 2023 14:36:23 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFEISKp011686 for ; Fri, 15 Dec 2023 14:36:22 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0re1ggte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFCn8Uo013886; Fri, 15 Dec 2023 14:36:21 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw592r2py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:21 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaIwE41550208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:18 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A481A20043; Fri, 15 Dec 2023 14:36:18 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7781320040; Fri, 15 Dec 2023 14:36:18 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 15 Dec 2023 14:36:18 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 0/7] s390: Optionally print instruction description in disassembly Date: Fri, 15 Dec 2023 15:36:09 +0100 Message-Id: <20231215143616.820185-1-jremus@linux.ibm.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: BW5t0Ii96W1Hdqg2080axUJjgNungMBI X-Proofpoint-GUID: k8KkvUjptNpwhOY8wHSJW1Z0X3VpvKvn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-15_08,2023-12-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=387 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 suspectscore=0 spamscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150100 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: With this patch series the s390 disassembler optionally prints the instruction descriptions as comment in the disassembly. This is enabled by specifying the new s390-specific disassembler option "insndesc". Patches 2-5 are preparatory cleanup/enhancement patches that patch 6 builds upon. Patch 1 is a cleanup in the s390-mkopc build, that I stumbled upon. New: Patch 2 is a cleanup of the letter case of instruction descriptions as preparation for patch 6. New: Patch 3 provides the IBM z16 instruction descriptions as preparation for patch 6. New: Patch 4 enhances the error handling in s390-mkopc. New: Patch 5 is a general cleanup to use strncpy() and snprintf() instead of strcpy() and strcat() and to use length macros for strings in s390-mkopc. Updated: Patch 6 (formerly 2) allows to optionally print the instruction descriptions as comments using the s390-specific disassembler option "insndesc". It now uses strncpy() instead of strcpy() as well as a length macro for the instruction description string. New: Patch 7 suffixes the instruction descriptions of conditional branch extended mnemonics with their condition (e.g. "on A high"). This complements patch 6. Example output: $ objdump -d -M insndesc test ... 0000000000000620 : 620: c0 10 00 00 0d 5c larl %r1,20d8 <__TMC_END__> # load address relative long 626: c0 20 00 00 0d 59 larl %r2,20d8 <__TMC_END__> # load address relative long 62c: ec 12 00 0a 80 64 cgrje %r1,%r2,640 # compare and branch relative (64) on A equal B 632: c4 18 00 00 0c d7 lgrl %r1,1fe0 <_ITM_deregisterTMCloneTable@Base> # load relative long (64) 638: ec 18 00 04 00 7c cgije %r1,0,640 # compare immediate and branch relative (64<8) on A equal B 63e: 07 f1 br %r1 # unconditional branch 640: 07 fe br %r14 # unconditional branch Note that the readability can be enhanced by using a filter such as "expand": $ objdump -d -M insndesc test | expand -t 8,16,24,32,40,80 ... 0000000000000620 : 620: c0 10 00 00 0d 5c larl %r1,20d8 <__TMC_END__> # load address relative long 626: c0 20 00 00 0d 59 larl %r2,20d8 <__TMC_END__> # load address relative long 62c: ec 12 00 0a 80 64 cgrje %r1,%r2,640 # compare and branch relative (64) on A equal B 632: c4 18 00 00 0c d7 lgrl %r1,1fe0 <_ITM_deregisterTMCloneTable@Base> # load relative long (64) 638: ec 18 00 04 00 7c cgije %r1,0,640 # compare immediate and branch relative (64<8) on A equal B 63e: 07 f1 br %r1 # unconditional branch 640: 07 fe br %r14 # unconditional branch Regards, Jens Jens Remus (7): s390: Fix build when using EXEEXT_FOR_BUILD s390: Align letter case of instruction descriptions s390: Provide IBM z16 (arch14) instruction descriptions s390: Enhance error handling in s390-mkopc s390: Use safe string functions and length macros in s390-mkopc s390: Optionally print instruction description in disassembly s390: Add suffix to conditional branch instruction descriptions binutils/NEWS | 5 + gas/testsuite/gas/s390/s390.exp | 1 + gas/testsuite/gas/s390/zarch-insndesc.d | 19 ++ gas/testsuite/gas/s390/zarch-insndesc.s | 12 ++ include/opcode/s390.h | 5 +- opcodes/Makefile.am | 7 +- opcodes/Makefile.in | 7 +- opcodes/s390-dis.c | 13 +- opcodes/s390-mkopc.c | 219 +++++++++++++++--------- opcodes/s390-opc.c | 62 +++---- opcodes/s390-opc.txt | 98 ++++++----- 11 files changed, 289 insertions(+), 159 deletions(-) create mode 100644 gas/testsuite/gas/s390/zarch-insndesc.d create mode 100644 gas/testsuite/gas/s390/zarch-insndesc.s -- 2.40.1