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 A688938582BD for ; Fri, 15 Dec 2023 14:39:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A688938582BD 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 A688938582BD 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=1702651167; cv=none; b=sOrX+KmJlj1s0gZEz2X1oiuT74T2q7ASq7mFo6BbEB+fyoULLlcHfhYW5dTxi1AoGJJ3A0GMACoBtLYxYmyUQZQgT/+PzSSYIRIlx4KDVmvo7yoBsxWS2S3wVg0mfc/+WRIKoolSI0KjkfPHgMLZ9Q0bqmUqx+80bLrez+IHBdY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702651167; c=relaxed/simple; bh=YjD52XDovKoRm8vsufCbi3DtVMgoX32DJRfHL+aZbNE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=TgFtOuI7CHT77TJMNPmM+67kK43aZ8ahcXoa/Kdw+589LmEhcW6Mu2WflVbAmijquTSit+gUOflyOMAMxiJv9xMksI4C3ApRj2D97TRSTkEgG/e5yTvqXI46cGd6Hau99/bFbqxpDnLs2JxJPFm621jIqgZRNHL3I58W8EGl+pM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEdIDZ010417 for ; Fri, 15 Dec 2023 14:39:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=9s0iz1jBANxI4WOw6n+ZaH1+OvLMMUwLEgrRtQFeOFc=; b=SwJdM02u3yf9MYHfhgvMKTEKgAkniOclW+NWRy0/KuU1lVAtrkhB16Y3vaNVMo5HAZKw dxqb7PsPpkjb2Y2hMYtVpywMvE7aOjWcoKcEd05KW1RMVRoAPAI9S1UMzPqycuyetHAr vgsByRTgqq2Ymsl9UPZTX9r4NJ+FfE3m80rEy81X8Btq6bcQ2U9UxTlNxvLnTwAL8y2U D6QfajpIPDuQwnDNrlUagvHEett4Q39ofaTJgC3TOZYC4sLfBpQZ140O93l3JAywlGfl bHGstaiRr3hUysYmDNDrHBJJ4pc/7LdbPI/lO1KDBwqUBxCfG95lru3yrkBOHg8/6Hl4 jA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0pvvb59u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Dec 2023 14:39:24 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFDGK2g009406 for ; Fri, 15 Dec 2023 14:39:23 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0pvvb4tk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:39:22 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFD4BJX008462; Fri, 15 Dec 2023 14:36:23 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3uw2ju0u8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:23 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaK6922479366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:20 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B1AD20040; Fri, 15 Dec 2023 14:36:20 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 257582004B; Fri, 15 Dec 2023 14:36:20 +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:20 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 7/7] s390: Add suffix to conditional branch instruction descriptions Date: Fri, 15 Dec 2023 15:36:16 +0100 Message-Id: <20231215143616.820185-8-jremus@linux.ibm.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231215143616.820185-1-jremus@linux.ibm.com> References: <20231215143616.820185-1-jremus@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: brvSZRv4dz-zqd7cIDiA5-l-NBd1-1JW X-Proofpoint-ORIG-GUID: 2h8UMi2Eccv_yk2PKf2EAGTjWonVcQ5a 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 spamscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150100 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,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: Suffix the instruction description of conditional branch extended mnemonics with their condition (e.g. "on A high"). This complements the optional printing of instruction descriptions as comments in the disassembly. Due to the added text the maximum description length is increased from 80 to 128 characters (including the trailing '\0' character). opcodes/ * s390-mkopc.c: Add suffix to conditional branch extended mnemonic instruction descriptions. gas/ * testsuite/gas/s390/zarch-insndesc.s: Add test cases for printing of suffixed instruction description of conditional branch extended mnemonics. * testsuite/gas/s390/zarch-insndesc.d: Likewise. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- gas/testsuite/gas/s390/zarch-insndesc.d | 2 + gas/testsuite/gas/s390/zarch-insndesc.s | 2 + opcodes/s390-mkopc.c | 78 ++++++++++++++----------- 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/gas/testsuite/gas/s390/zarch-insndesc.d b/gas/testsuite/gas/s390/zarch-insndesc.d index 9a121fb2c30..2ac0c7a0ca7 100644 --- a/gas/testsuite/gas/s390/zarch-insndesc.d +++ b/gas/testsuite/gas/s390/zarch-insndesc.d @@ -14,4 +14,6 @@ Disassembly of section .text: .*: ec 67 0c 8d 0e 5d [ ]*risbhgz %r6,%r7,12,13,14 # rotate then insert selected bits high and zero remaining bits .*: b3 96 37 59 [ ]*cxfbra %f5,3,%r9,7 # convert from 32 bit fixed to extended bfp with rounding mode .*: ec 67 0c 94 0e 59 [ ]*risbgnz %r6,%r7,12,20,14 # rotate then insert selected bits and zero remaining bits nocc +.*: ec 6e 80 03 00 4e [ ]*lochhino %r6,-32765 # load halfword high immediate on condition on not overflow / if not ones + *([\da-f]+): ec 6a 00 00 d6 7c [ ]*cgijnl %r6,-42,\1 # compare immediate and branch relative \(64<8\) on A not low .*: 07 07 [ ]*nopr %r7 # no operation diff --git a/gas/testsuite/gas/s390/zarch-insndesc.s b/gas/testsuite/gas/s390/zarch-insndesc.s index e964315f0af..446832f813d 100644 --- a/gas/testsuite/gas/s390/zarch-insndesc.s +++ b/gas/testsuite/gas/s390/zarch-insndesc.s @@ -8,3 +8,5 @@ foo: risbhgz %r6,%r7,12,13,14 cxfbra %f5,3,%r9,7 risbgnz %r6,%r7,12,20,14 + lochhino %r6,-32765 + cgijnl %r6,-42,. diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c index c6930a3e9b5..025dbdb037f 100644 --- a/opcodes/s390-mkopc.c +++ b/opcodes/s390-mkopc.c @@ -32,7 +32,7 @@ #define MAX_OPCODE_LEN 15 #define MAX_MNEMONIC_LEN 15 #define MAX_FORMAT_LEN 15 -#define MAX_DESCRIPTION_LEN 79 +#define MAX_DESCRIPTION_LEN 127 #define MAX_CPU_LEN 15 #define MAX_MODES_LEN 15 @@ -142,50 +142,52 @@ struct s390_cond_ext_format { char nibble; char extension[4]; + char *description_suffix; + }; /* The mnemonic extensions for conditional jumps used to replace the '*' tag. */ #define NUM_COND_EXTENSIONS 20 const struct s390_cond_ext_format s390_cond_extensions[NUM_COND_EXTENSIONS] = -{ { '1', "o" }, /* jump on overflow / if ones */ - { '2', "h" }, /* jump on A high */ - { '2', "p" }, /* jump on plus */ - { '3', "nle" }, /* jump on not low or equal */ - { '4', "l" }, /* jump on A low */ - { '4', "m" }, /* jump on minus / if mixed */ - { '5', "nhe" }, /* jump on not high or equal */ - { '6', "lh" }, /* jump on low or high */ - { '7', "ne" }, /* jump on A not equal B */ - { '7', "nz" }, /* jump on not zero / if not zeros */ - { '8', "e" }, /* jump on A equal B */ - { '8', "z" }, /* jump on zero / if zeros */ - { '9', "nlh" }, /* jump on not low or high */ - { 'a', "he" }, /* jump on high or equal */ - { 'b', "nl" }, /* jump on A not low */ - { 'b', "nm" }, /* jump on not minus / if not mixed */ - { 'c', "le" }, /* jump on low or equal */ - { 'd', "nh" }, /* jump on A not high */ - { 'd', "np" }, /* jump on not plus */ - { 'e', "no" }, /* jump on not overflow / if not ones */ +{ { '1', "o", "on overflow / if ones"}, /* jump on overflow / if ones */ + { '2', "h", "on A high"}, /* jump on A high */ + { '2', "p", "on plus" }, /* jump on plus */ + { '3', "nle", "on not low or equal" }, /* jump on not low or equal */ + { '4', "l", "on A low" }, /* jump on A low */ + { '4', "m", "on minus / if mixed" }, /* jump on minus / if mixed */ + { '5', "nhe", "on not high or equal" }, /* jump on not high or equal */ + { '6', "lh", "on low or high" }, /* jump on low or high */ + { '7', "ne", "on A not equal B" }, /* jump on A not equal B */ + { '7', "nz", "on not zero / if not zeros" }, /* jump on not zero / if not zeros */ + { '8', "e", "on A equal B" }, /* jump on A equal B */ + { '8', "z", "on zero / if zeros" }, /* jump on zero / if zeros */ + { '9', "nlh", "on not low or high " }, /* jump on not low or high */ + { 'a', "he", "on high or equal" }, /* jump on high or equal */ + { 'b', "nl", "on A not low" }, /* jump on A not low */ + { 'b', "nm", "on not minus / if not mixed" }, /* jump on not minus / if not mixed */ + { 'c', "le", "on low or equal" }, /* jump on low or equal */ + { 'd', "nh", "on A not high" }, /* jump on A not high */ + { 'd', "np", "on not plus" }, /* jump on not plus */ + { 'e', "no", "on not overflow / if not ones" },/* jump on not overflow / if not ones */ }; /* The mnemonic extensions for conditional branches used to replace the '$' tag. */ #define NUM_CRB_EXTENSIONS 12 const struct s390_cond_ext_format s390_crb_extensions[NUM_CRB_EXTENSIONS] = -{ { '2', "h" }, /* jump on A high */ - { '2', "nle" }, /* jump on not low or equal */ - { '4', "l" }, /* jump on A low */ - { '4', "nhe" }, /* jump on not high or equal */ - { '6', "ne" }, /* jump on A not equal B */ - { '6', "lh" }, /* jump on low or high */ - { '8', "e" }, /* jump on A equal B */ - { '8', "nlh" }, /* jump on not low or high */ - { 'a', "nl" }, /* jump on A not low */ - { 'a', "he" }, /* jump on high or equal */ - { 'c', "nh" }, /* jump on A not high */ - { 'c', "le" }, /* jump on low or equal */ +{ { '2', "h", "on A high" }, /* jump on A high */ + { '2', "nle", "on not low or equal" }, /* jump on not low or equal */ + { '4', "l", "on A low" }, /* jump on A low */ + { '4', "nhe", "on not high or equal" }, /* jump on not high or equal */ + { '6', "ne", "on A not equal B" }, /* jump on A not equal B */ + { '6', "lh", "on low or high" }, /* jump on low or high */ + { '8', "e", "on A equal B" }, /* jump on A equal B */ + { '8', "nlh", "on not low or high" }, /* jump on not low or high */ + { 'a', "nl", "on A not low" }, /* jump on A not low */ + { 'a', "he", "on high or equal" }, /* jump on high or equal */ + { 'c', "nh", "on A not high" }, /* jump on A not high */ + { 'c', "le", "on low or equal" }, /* jump on low or equal */ }; /* As with insertOpcode instructions are added to the sorted opcode @@ -283,6 +285,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, for (i = 0; i < ext_table_length; i++) { char new_mnemonic[MAX_MNEMONIC_LEN + 1]; + char new_description[MAX_DESCRIPTION_LEN + 1]; opcode[mask_start] = ext_table[i].nibble; @@ -293,7 +296,14 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, return; } - insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags, description); + if (snprintf (new_description, sizeof (new_description), "%s %s", description, + ext_table[i].description_suffix) >= sizeof (new_description)) + { + print_error ("Mnemonic \"%s\": Concatenated description exceeds max. length\n", mnemonic); + return; + } + + insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags, new_description); } return; -- 2.40.1