From patchwork Fri Dec 15 14:36:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9321260dys; Fri, 15 Dec 2023 06:36:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXMmJu61X4AAcKFqjBF8Wcvjm68V7CekGbetd7kn60z6+8dByr5Hkl8mzo0hyJ02DzavP5 X-Received: by 2002:a05:622a:509:b0:423:6fca:66f1 with SMTP id l9-20020a05622a050900b004236fca66f1mr15816233qtx.0.1702650994356; Fri, 15 Dec 2023 06:36:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702650994; cv=pass; d=google.com; s=arc-20160816; b=pssPYixHe4ftb4DlokgfpuyzUmeSjKIa4RyO1ZEkyqzRYxjYvafRM5ZdRYNTV3sDBA OcvKjjI5Kub4kqdQh0Z6vHH8peM8i45bE0iUU5H3ECV4ln4caTZ6LjiblxdidSKkxdv9 vkBfFJaFl0e3w2Gypps7xApXTQdonZvfJOObG1J0embI7PhzMHsY/34uyWLKBXAlEc/e p5wYr9l9YiJcdEg/M10BAfF+CRvJHjgZk3+OyOxwjWDtLTK7+0LcmhGRRKDFPLnlLMcG sk4yGq01E2KkO+nSBxAKNOL4UUDPUvzJghkjyKI1cXqmpXtb5cTHynJx8kk4cHQot74q 5mtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=7Ok5O8VNG/bWe3W5ERL0I4vMYbl1uI9iZkBjzOcCFJo=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=TJ836rYWgip5n63dN4U5XW4GkTN7BWIIc9NH/RzadQnWD5VQiE2OFsCz+78Yd6cyKj 248wQE8GYzFD3Tno3ylDGQzBzmmidVkFhuk52vziiiEBKXJOHrg1RCQ5V53H/UfRN1gG y5endcQ/BwuiTSosO1cCutcP7p+/7hYizKIROpcIPXBq1oU4jz0wn5AbbRbntnTvrDqZ vVRXURjti1wQbsRispzuVweHcV39PFuoEI3cjnEigzmMSNRpgxPO3t4/dGltV52CafvP 4Zd5rvkbKSE3B5eFcORsjjQuUtHcDNd3yMKCguT6O77mYx/v5xCFen02mjQ2diQ4wWdS mJ0w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BcN9AKBZ; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dn12-20020a05622a470c00b0042585e20c2csi15793634qtb.680.2023.12.15.06.36.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BcN9AKBZ; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41A663845BDF for ; Fri, 15 Dec 2023 14:36:32 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id D08F23858430 for ; Fri, 15 Dec 2023 14:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D08F23858430 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 D08F23858430 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650986; cv=none; b=MhIAf6VjCFUe/1xIhN+5px2XagfQ4pJ7ZPMCpic9++aCRP7XhMqPitqrt+kewPwWmZcq4Op7n3tED9c3+p8FspRC+xw+2zQ2aVqSbVvpjGHiew7Rzyhj+8yV8zRoKpqflk5b8ExESu8t1LaMo8+5REcN/IpzEGqpw3Ju8hKrz1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650986; c=relaxed/simple; bh=tZKRgLtSzXCLXSnBYNMctZ2RPzVj24noUwerzCdyspU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=SYcPBEK/wzjnNm/p6zdOjxhsnZJ+eUOgtLpNg0LD7uaXuovB6kvcRicFsKnfPmv7OGGNtct4CjeIYgPoJL5ZRE+H0WD68ays81+Y3IFDfkW00h99GNKDYao71Lsbq8lfH+L+Bw5uVi2gNpQjwbDv5+8Vt1QlBgER70fZIw4I8+k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEBnm5017166 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 : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=7Ok5O8VNG/bWe3W5ERL0I4vMYbl1uI9iZkBjzOcCFJo=; b=BcN9AKBZg+XETFNWiqtXZYOx5fwZDot364FfCnkjgmsnojqC+Qmjp2YmOcvXO+Dqw/yN zipzYAquITlT4kFleCInVxdGhw/729Ut0AUwfHHw2hZlj9WZ3KpKzBmZzOJzAjzlQgZ/ 5kEKlMAVZFeDEoRSfnCYfhlEdf29ehKT77vk9F6myKlbFVtCTfdY32WjNIdRwDfO9YOl qgw7hcbLluCagFlBNdSzFCOC05SOZKw1vPXyclHmBAjtJP0QpBz7uAOnysJ/J/ynsbbN I6xuOCJ+s0tVYmTG9CVb8MsJu7m/vx41sSdg4q8tWU+yi7G7AZ7pw0YiFkhpL+1Idbx/ iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0p154gc1-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 m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFECDQE019387 for ; Fri, 15 Dec 2023 14:36:22 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0p154gbp-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 (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFDwoqq012593; Fri, 15 Dec 2023 14:36:22 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw3jpgktv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +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 3BFEaIWe45482702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DCDE420040; 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 B05B62004B; 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 1/7] s390: Fix build when using EXEEXT_FOR_BUILD Date: Fri, 15 Dec 2023 15:36:10 +0100 Message-Id: <20231215143616.820185-2-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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: r5T3P6O4F6FYHwfLC5rki7gLRRXa6Ab4 X-Proofpoint-GUID: yB4-Np-7hydOaU8ERUTdl2B-mmISSp79 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 mlxscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150099 X-Spam-Status: No, score=-11.7 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785358968887336118 X-GMAIL-MSGID: 1785358968887336118 Suffix the s390-mkopc build utility executable file name with EXEEXT_FOR_BUILD. Otherwise it cannot be located when building with EXEEXT_FOR_BUILD. Use pattern used for other architecture build utilities and compile and link s390-mkopc in two steps. While at it also specify the dependencies of s390-mkopc.c. opcodes/ * Makefile.am: Add target to build s390-mkopc.o. Correct target to build s390-mkopc$(EXEEXT_FOR_BUILD). * Makefile.in: Regenerate. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- opcodes/Makefile.am | 7 +++++-- opcodes/Makefile.in | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index 5804dd1ab38..ea264989509 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -570,8 +570,11 @@ opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS) opc2c.o: opc2c.c $(INCDIR)/libiberty.h $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c -s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c - $(AM_V_CCLD)$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c +s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.o + $(AM_V_CCLD)$(LINK_FOR_BUILD) s390-mkopc.o + +s390-mkopc.o: s390-mkopc.c $(INCDIR)/opcode/s390.h + $(COMPILE_FOR_BUILD) -c $(srcdir)/s390-mkopc.c s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt $(AM_V_GEN)./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index e2c6e5a4374..7586b54fbd8 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -1548,8 +1548,11 @@ opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS) opc2c.o: opc2c.c $(INCDIR)/libiberty.h $(AM_V_CC)$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c -s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c - $(AM_V_CCLD)$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c +s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.o + $(AM_V_CCLD)$(LINK_FOR_BUILD) s390-mkopc.o + +s390-mkopc.o: s390-mkopc.c $(INCDIR)/opcode/s390.h + $(COMPILE_FOR_BUILD) -c $(srcdir)/s390-mkopc.c s390-opc.tab: s390-mkopc$(EXEEXT_FOR_BUILD) s390-opc.txt $(AM_V_GEN)./s390-mkopc$(EXEEXT_FOR_BUILD) < $(srcdir)/s390-opc.txt > s390-opc.tab From patchwork Fri Dec 15 14:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179333 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9322985dys; Fri, 15 Dec 2023 06:39:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHombZzuYv2y+dsK/RkXz/9TjEtMnhL3F5Mq5FJXgDxZhAUxrTo3kapzSXcxPjXl/9d/xH+ X-Received: by 2002:a05:622a:347:b0:425:4043:41bc with SMTP id r7-20020a05622a034700b00425404341bcmr15506570qtw.104.1702651170545; Fri, 15 Dec 2023 06:39:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651170; cv=pass; d=google.com; s=arc-20160816; b=1LExR4G4hSzNdJrl27ZtA3PNLhza2WuV6qTRGX+bOyK06o2WZsFIbuMx9KQps5rqc7 Ii7q70ei/caRkBIy8dKlKMK6h5qqO1CvwV7ai6Z7PAm3E2H4MWnIAl0rFNE+hdBPMDzv qV5TiJSF+H4RVXG2XMeeBrWu+fbtNsz98IVkvTRoR/gE51MIOlhgcHFL2nlVcJ+0rv0z SHHB8fW6nN2oim0Rp2VnqCYvN6bBwA33A5TNJNhUYJMN6YWQd7l7Lb5mT3ANr8S7Esxx bZaG6a6D4WMIlK4p4vbrXEh/VMheuyTHzjhghEA/FRftp4+kyZKY34gx/uXC1e14lCQQ 72Cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=IuG/dsmIyyhg1MI26ncDGa3EiwIUyKituG3/QH3erIE=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=xT7IejILxpWOwpbclHCWHXHz98offJ4/gQIfH1Ftc/YrJbd+BzdfUCYckYr4dABVyQ BlX0d0nBWTZpekFRNP44JyUCFQlictFDbZCRk6KcbyCpO99mlj0K8fch1yW0te0/M++Y zOq6LBExYfVLJ3id2amLg+WW17VAOIr4UueNcvCFv86ykBjplXPv4filNyVcuAc5Hl9w 8prQjf0+RnghsJeCLL8j96VGtmv6ZI52KuINf72IGJjs3vE1tNdIZHcXb/IryRrCbIOz o5nxPzbkvssjxhOKnU02aCxJRhDojsv7ZlqN6k2hDgO2FM4DXBObLoXUzLqvogKG5T42 ul7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oQPi9U+1; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h12-20020ac8514c000000b004258582ed33si16336906qtn.692.2023.12.15.06.39.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oQPi9U+1; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 337633847736 for ; Fri, 15 Dec 2023 14:39:30 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 822953858430 for ; Fri, 15 Dec 2023 14:39:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 822953858430 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 822953858430 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=1702651166; cv=none; b=bol5nx2jY7TwUpIOAE8VjpJAXQcOuyZ57zy0IKnm9v66/D2kqXXZKDbpK9mxragWNGf0ez4jOxRQbgFo22u4R1xldE2RIJGggJQUZDJOnHRw7KOlIVpZ3RrCmf9k0Nae6xR+uHga6gTQ+819Y14w3jIod3e9IfM6zgLv5Jsps7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702651166; c=relaxed/simple; bh=IY6w0uOYGXwpraqWHl6esoLNWWpitzDWa6P74qEdXYU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=v0M+fItDQZIU/M4qgcSs2V7+aoz+uols/F1tO4JexIOvfXkAprsaIgJufmYQ5UIRFOrb3kfexXdQkB8/R0rvu/A2LW2irpRAxnVD2Bx1lWa+rrXm4+53XWteyckBJfjoPvfzxSbAODGfVUsBTktRUt5TDDorVKgURQvdIA6A1iA= 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 3BFEdI5d010414 for ; Fri, 15 Dec 2023 14:39:23 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=IuG/dsmIyyhg1MI26ncDGa3EiwIUyKituG3/QH3erIE=; b=oQPi9U+180hq6ECnugyVsOrKZkRzowIKMaPP7PfmGRkDZnPk2ysybuPJADca6NuGRRUW SYAstVs3Ho7gQdUwDAcn5VStckltlYAILEZkJP/Dy5DrLpIAw3j1oj+Rc6pXb+GkcqVe wqkDwoRakrDSF0xHkw9+VEd2GrMGtGG6cPb/pmUOzKlkXKz3voW2pU2ygUFV7FGxx5mA +C/qzPJz6YFFtyMitGRxsUeM8K5+XNUy4yNobdn2tV48UdcIolyqunNHsEBIIXYynWnY 58CDCy9cTIX3UhLbtr2p7eEQZbOpv398PwJ5guItnWrTMZc0C7Gu0ra0OfAHmOyJnpRU ig== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0pvvb59s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Dec 2023 14:39:23 +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 3BFEIgXe031027 for ; Fri, 15 Dec 2023 14:39:22 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0pvvb4tg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:39:21 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFDlAAX012616; Fri, 15 Dec 2023 14:36:22 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw3jpgktx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaJru15008428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20E4B20040; Fri, 15 Dec 2023 14:36:19 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E87E520043; 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 2/7] s390: Align letter case of instruction descriptions Date: Fri, 15 Dec 2023 15:36:11 +0100 Message-Id: <20231215143616.820185-3-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 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fVkEMQ1o3n_cwv-TbGTLY6Lsrt6LhLrk X-Proofpoint-ORIG-GUID: vWoSRXabrRKWEPAOtV4KK_cdOZ4CZqf9 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=680 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150100 X-Spam-Status: No, score=-12.0 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785359153899479758 X-GMAIL-MSGID: 1785359153899479758 Change the bitwise operations names "and" and "or" to lower case. Change the register name abbreviations "FPR", "GR", and "VR" to upper case. opcodes/ * s390-opc.txt: Align letter case of instruction descriptions. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- opcodes/s390-opc.txt | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt index 0fd04ee2770..ef4ef9dc517 100644 --- a/opcodes/s390-opc.txt +++ b/opcodes/s390-opc.txt @@ -144,14 +144,14 @@ d3 mvz SS_L0RDRD "move zones" g5 esa,zarch 67 mxd RX_FERRD "multiply (long to ext.)" g5 esa,zarch 27 mxdr RR_FEF "multiply (long to ext.)" g5 esa,zarch 26 mxr RR_FEFE "multiply (ext.)" g5 esa,zarch -54 n RX_RRRD "AND" g5 esa,zarch -d4 nc SS_L0RDRD "AND" g5 esa,zarch -94 ni SI_URD "AND" g5 esa,zarch -14 nr RR_RR "AND" g5 esa,zarch -56 o RX_RRRD "OR" g5 esa,zarch -d6 oc SS_L0RDRD "OR" g5 esa,zarch -96 oi SI_URD "OR" g5 esa,zarch -16 or RR_RR "OR" g5 esa,zarch +54 n RX_RRRD "and" g5 esa,zarch +d4 nc SS_L0RDRD "and" g5 esa,zarch +94 ni SI_URD "and" g5 esa,zarch +14 nr RR_RR "and" g5 esa,zarch +56 o RX_RRRD "or" g5 esa,zarch +d6 oc SS_L0RDRD "or" g5 esa,zarch +96 oi SI_URD "or" g5 esa,zarch +16 or RR_RR "or" g5 esa,zarch f2 pack SS_LLRDRD "pack" g5 esa,zarch b248 palb RRE_00 "purge ALB" g5 esa,zarch b218 pc S_RD "program call" g5 esa,zarch @@ -215,8 +215,8 @@ b6 stctl RS_CCRD "store control" g5 esa,zarch 40 sth RX_RRRD "store halfword" g5 esa,zarch b202 stidp S_RD "store CPU id" g5 esa,zarch 90 stm RS_RRRD "store multiple" g5 esa,zarch -ac stnsm SI_URD "store then AND system mask" g5 esa,zarch -ad stosm SI_URD "store then OR system mask" g5 esa,zarch +ac stnsm SI_URD "store then and system mask" g5 esa,zarch +ad stosm SI_URD "store then or system mask" g5 esa,zarch b209 stpt S_RD "store CPU timer" g5 esa,zarch b211 stpx S_RD "store prefix" g5 esa,zarch b234 stsch S_RD "store subchannel" g5 esa,zarch @@ -239,10 +239,10 @@ dd trt SS_L0RDRD "translate and test" g5 esa,zarch b235 tsch S_RD "test subchannel" g5 esa,zarch f3 unpk SS_LLRDRD "unpack" g5 esa,zarch 0102 upt E "update tree" g5 esa,zarch -57 x RX_RRRD "exclusive OR" g5 esa,zarch -d7 xc SS_L0RDRD "exclusive OR" g5 esa,zarch -97 xi SI_URD "exclusive OR" g5 esa,zarch -17 xr RR_RR "exclusive OR" g5 esa,zarch +57 x RX_RRRD "exclusive or" g5 esa,zarch +d7 xc SS_L0RDRD "exclusive or" g5 esa,zarch +97 xi SI_URD "exclusive or" g5 esa,zarch +17 xr RR_RR "exclusive or" g5 esa,zarch f8 zap SS_LLRDRD "zero and add" g5 esa,zarch a70a ahi RI_RI "add halfword immediate" g5 esa,zarch 84 brxh RSI_RRP "branch relative on index high" g5 esa,zarch condjump @@ -821,8 +821,8 @@ b370 lpdfr RRE_FF "load positive no cc" z9-ec zarch b371 lndfr RRE_FF "load negative no cc" z9-ec zarch b372 cpsdr RRF_F0FF2 "copy sign" z9-ec zarch b373 lcdfr RRE_FF "load complement no cc" z9-ec zarch -b3c1 ldgr RRE_FR "load fpr from gr" z9-ec zarch -b3cd lgdr RRE_RF "load gr from fpr" z9-ec zarch +b3c1 ldgr RRE_FR "load FPR from GR" z9-ec zarch +b3cd lgdr RRE_RF "load GR from FPR" z9-ec zarch b3d2 adtr RRR_F0FF "add long dfp" z9-ec zarch b3da axtr RRR_FE0FEFE "add extended dfp" z9-ec zarch b3e4 cdtr RRE_FF "compare long dfp" z9-ec zarch @@ -1203,11 +1203,11 @@ e70000000040 vleib VRI_V0IU "vector load byte element immediate" z13 zarch vx e70000000041 vleih VRI_V0IU "vector load halfword element immediate" z13 zarch vx e70000000043 vleif VRI_V0IU "vector load word element immediate" z13 zarch vx e70000000042 vleig VRI_V0IU "vector load double word element immediate" z13 zarch vx -e70000000021 vlgv VRS_RVRDU "vector load gr from vr element" z13 zarch vx -e70000000021 vlgvb VRS_RVRD "vector load gr from vr byte element" z13 zarch vx -e70000001021 vlgvh VRS_RVRD "vector load gr from vr halfword element" z13 zarch vx -e70000002021 vlgvf VRS_RVRD "vector load gr from vr word element" z13 zarch vx -e70000003021 vlgvg VRS_RVRD "vector load gr from vr double word element" z13 zarch vx +e70000000021 vlgv VRS_RVRDU "vector load GR from VR element" z13 zarch vx +e70000000021 vlgvb VRS_RVRD "vector load GR from VR byte element" z13 zarch vx +e70000001021 vlgvh VRS_RVRD "vector load GR from VR halfword element" z13 zarch vx +e70000002021 vlgvf VRS_RVRD "vector load GR from VR word element" z13 zarch vx +e70000003021 vlgvg VRS_RVRD "vector load GR from VR double word element" z13 zarch vx e70000000004 vllez VRX_VRRDU "vector load logical element and zero" z13 zarch vx e70000000004 vllezb VRX_VRRD "vector load logical byte element and zero" z13 zarch vx e70000001004 vllezh VRX_VRRD "vector load logical halfword element and zero" z13 zarch vx From patchwork Fri Dec 15 14:36:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179329 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9321832dys; Fri, 15 Dec 2023 06:37:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/ug6kKVKTYusLocLVff3P4Apk7i9wPqNVB/xanOYf73rQ16sGyirAN4xhDewXDZoESxd5 X-Received: by 2002:a05:6808:219f:b0:3b8:b2cf:3106 with SMTP id be31-20020a056808219f00b003b8b2cf3106mr15355933oib.25.1702651051963; Fri, 15 Dec 2023 06:37:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651051; cv=pass; d=google.com; s=arc-20160816; b=gW75LAccKdS8yOQ83G8a56luDMOEgt07dSAbPjxxbFj5kpk+OJXxdCz3GQTAQhrPtQ AvMob4+Q77Pg7Wkh3eFwjUO5CshwECAmrnFD09CCpQXbBcb/MoWdYhkSmYIfGRazUWXZ ERB/dfPOnxAZJzY6nhMr5XmKBegtAK8JVOvgCAJsqZjZ/UMqp43JP/3Yjzg72fB1tCep GTo8TqvJrQVabqqnBExb9/S41puDITDvFP9RoDVsVtsA9UUbHiBcMDiipUVd1EleiRpi hvcBpbxPvKqAeZJ+QvPI/0Ox+dIHwigiHKub2rPSqi7klbiGPrAW7FMR6Th+zv3XVzPf bLnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=OQpzk7kkSID/PqgDqLaqDtHLwVGJQsMS6YjYbPrwouk=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=oq5fFOemAZc6ORbYMidf7Yus0QUrSyUJMWJUkoOdW6cxgL/9x2v+sxf4RMkJJeruyC XJiGP4RwcaqowBKj00rUawdqGqtuu8x9h/WbpCRjVUAxqqKyLtujyS9fQ8GHXKawLLEf tYmLprgFcr1rd24nHysYnGhctlcW6F//lJb9Ee2jUyahmD5IYn5xvfy+tkoS29ryVKiY 8x+sBfHqSlGxeKwzGxrXVJejBw5qnTXmHpc9UnjPA96bYmch5ifIa8d8EvRPaZ3Wbnwq UkbQPbIfr4YxiBTE1y4FN70oLpHy+cPVIodTQAb9LIr3UTjd7pcJ/em8yOfnTmrLwloc rMkw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kE5vtTAA; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i16-20020a05620a0a1000b0077fb5a87728si764882qka.171.2023.12.15.06.37.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:37:31 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=kE5vtTAA; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5B0038449F5 for ; Fri, 15 Dec 2023 14:37:06 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 6D3F038582AF for ; Fri, 15 Dec 2023 14:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6D3F038582AF 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 6D3F038582AF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; cv=none; b=pi0k7etd+4Yzul7hwo7KurxZD2aZax5+WcF/tov7AsYprC7olLdthUyTGQ3nli8jVW2QB80h1fMsrWykyTFyg5v4j4GWtC7ELLESqIagqj/KbV2FowR397edBCICezeP6zcMs9AMLMrno1doSRM9JnCfJgBW2UKrRFG3FDvqThE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; c=relaxed/simple; bh=peNbpxrNiCfrXS1ZbeN5fjBgNURYhL4KErOmYWhXEHE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=FNL1XV5wFmU6JwxXRuoRyDi02ZN8ufx28NmXJw62xn7H3UKuEu2W/KOW+ytghoOLg4Vr0rfLn7J70+V1av/3E/ZYK8+O08odvgu8G3vU7sgePnPoI2J2Mqlo9pyaRiGpNt8hN8rCZzKmpQo9gTnYbPFc6R73JeG6bcmdbm7O/nw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEHtdV031993 for ; Fri, 15 Dec 2023 14:36: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 : content-transfer-encoding : mime-version; s=pp1; bh=OQpzk7kkSID/PqgDqLaqDtHLwVGJQsMS6YjYbPrwouk=; b=kE5vtTAAnuuWEbNOr1pIyyi8G2JdD9xUFdOqAdhdRvgWu7Kw0g9t49T83DYVaHZY6fHX ODGUWN1KfGu+JRhoJl54lLRI95ae5+6QXhzxzakuTbVUIksgm3NZBqUzHsUGJENy4Yrl k935lnN2kZICEILGjFfAgyDZBV8E0jDDB9kqppV63X+1qqORdOh/NW+LiQSPGHU0EAiK L3ue8q4bmdf0sDOofRNOpCPIrre4n9MWN3EOBQaWmEnd9992GNut2fMFLjl39Nizfu2J yAHNiLiqqlGgodp5kFh95ighYpetuRhaS6OIDqp06aFfl0evRETtCIQM0G4isDwq1o0q Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0reg0gwc-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 m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFEM1KD015433 for ; Fri, 15 Dec 2023 14:36:23 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0reg0gw7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:23 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFDmFxa028244; Fri, 15 Dec 2023 14:36:22 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw2y08q2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaJ4T15008430 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5866C20040; Fri, 15 Dec 2023 14:36:19 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2C4F82004B; Fri, 15 Dec 2023 14:36:19 +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:19 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 3/7] s390: Provide IBM z16 (arch14) instruction descriptions Date: Fri, 15 Dec 2023 15:36:12 +0100 Message-Id: <20231215143616.820185-4-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> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: nVVrv02VNkr6jXy6jN-MDSWRCsG1MbRi X-Proofpoint-GUID: cP-AMCK9lQg10xqmaw7PIfQghYh0-VfJ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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 mlxlogscore=999 mlxscore=0 clxscore=1015 malwarescore=0 suspectscore=0 phishscore=0 adultscore=0 impostorscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150099 X-Spam-Status: No, score=-11.8 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785359029286592167 X-GMAIL-MSGID: 1785359029286592167 Provide descriptions for instructions introduced with commit ba2b480f103 ("IBM Z: Implement instruction set extensions"). This complements commit 69341966def ("IBM zSystems: Add support for z16 as CPU name."). Use instruction names from IBM z/Architecture Principles of Operation [1] as instruction description. [1]: IBM z/Architecture Principles of Operation, SA22-7832-13, IBM z16, https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf opcodes/ * s390-opc.txt: Add descriptions for IBM z16 (arch14) instructions. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- opcodes/s390-opc.txt | 66 +++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt index ef4ef9dc517..a3117eeebc5 100644 --- a/opcodes/s390-opc.txt +++ b/opcodes/s390-opc.txt @@ -2034,31 +2034,41 @@ e60000000052 vcvbg VRR_RV0UU "vector convert to binary 64 bit" arch13 zarch optp b93a kdsa RRE_RR "compute digital signature authentication" arch13 zarch -# arch14 instructions - -e60000000074 vschp VRR_VVV0U0U " " arch14 zarch -e60000002074 vschsp VRR_VVV0U0 " " arch14 zarch -e60000003074 vschdp VRR_VVV0U0 " " arch14 zarch -e60000004074 vschxp VRR_VVV0U0 " " arch14 zarch -e6000000007c vscshp VRR_VVV " " arch14 zarch -e6000000007d vcsph VRR_VVV0U0 " " arch14 zarch -e60000000051 vclzdp VRR_VV0U2 " " arch14 zarch -e60000000070 vpkzr VRI_VVV0UU2 " " arch14 zarch -e60000000072 vsrpr VRI_VVV0UU2 " " arch14 zarch -e60000000054 vupkzh VRR_VV0U2 " " arch14 zarch -e6000000005c vupkzl VRR_VV0U2 " " arch14 zarch - -b93b nnpa RRE_00 " " arch14 zarch -e60000000056 vclfnh VRR_VV0UU2 " " arch14 zarch -e6000000005e vclfnl VRR_VV0UU2 " " arch14 zarch -e60000000075 vcrnf VRR_VVV0UU " " arch14 zarch -e6000000005d vcfn VRR_VV0UU2 " " arch14 zarch -e60000000055 vcnf VRR_VV0UU2 " " arch14 zarch - -b98B rdp RRF_RURR2 " " arch14 zarch optparm - -eb0000000071 lpswey SIY_RD " " arch14 zarch -b200 lbear S_RD " " arch14 zarch -b201 stbear S_RD " " arch14 zarch - -b28f qpaci S_RD " " arch14 zarch +# arch14 (z16) instructions + +# Vector-Packed-Decimal-Enhancement Facility 2 + +e60000000074 vschp VRR_VVV0U0U "decimal scale and convert to hfp" arch14 zarch +e60000002074 vschsp VRR_VVV0U0 "decimal scale and convert to short hfp" arch14 zarch +e60000003074 vschdp VRR_VVV0U0 "decimal scale and convert to long hfp" arch14 zarch +e60000004074 vschxp VRR_VVV0U0 "decimal scale and convert to extended hfp" arch14 zarch +e6000000007c vscshp VRR_VVV "decimal scale and convert and split to hfp" arch14 zarch +e6000000007d vcsph VRR_VVV0U0 "vector convert hfp to scaled decimal" arch14 zarch +e60000000051 vclzdp VRR_VV0U2 "vector count leading zero digits" arch14 zarch +e60000000070 vpkzr VRI_VVV0UU2 "vector pack zoned register" arch14 zarch +e60000000072 vsrpr VRI_VVV0UU2 "vector shift and round decimal register" arch14 zarch +e60000000054 vupkzh VRR_VV0U2 "vector unpack zoned high" arch14 zarch +e6000000005c vupkzl VRR_VV0U2 "vector unpack zoned low" arch14 zarch + +# Neural-Network-Processing-Assist Facility + +b93b nnpa RRE_00 "neural network processing assist" arch14 zarch +e60000000056 vclfnh VRR_VV0UU2 "vector fp convert and lengthen from nnp high" arch14 zarch +e6000000005e vclfnl VRR_VV0UU2 "vector fp convert and lengthen from nnp low" arch14 zarch +e60000000075 vcrnf VRR_VVV0UU "vector fp convert and round to nnp" arch14 zarch +e6000000005d vcfn VRR_VV0UU2 "vector fp convert from nnp" arch14 zarch +e60000000055 vcnf VRR_VV0UU2 "vector fp convert to nnp" arch14 zarch + +# Reset-DAT-Protection Facility + +b98B rdp RRF_RURR2 "reset dat protection" arch14 zarch optparm + +# BEAR-Enhancement Facility + +eb0000000071 lpswey SIY_RD "load PSW extended" arch14 zarch +b200 lbear S_RD "load bear" arch14 zarch +b201 stbear S_RD "store bear" arch14 zarch + +# Processor-Activity-Instrumentation Facility + +b28f qpaci S_RD "query processor activity counter information" arch14 zarch From patchwork Fri Dec 15 14:36:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179331 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9322283dys; Fri, 15 Dec 2023 06:38:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvfghPQcers8GGNFOWqJi/foN0iO/sEAI9uBOnEh6yRFc7aXpqw9CZy3otZmBY46gcdTxN X-Received: by 2002:ad4:4186:0:b0:67a:a721:783d with SMTP id e6-20020ad44186000000b0067aa721783dmr11350339qvp.98.1702651093643; Fri, 15 Dec 2023 06:38:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651093; cv=pass; d=google.com; s=arc-20160816; b=ZnfFIEaUSmCg7gxJ3DV2m91xCV53LKp+9RatZPkQflTY/yh9CjaWYV5ezs/FwzQEPN dgKlQcHZ+cUS+8GRIRguGQPB7iIZoYmFcQlERmNwCSFFoSGIq9UVLvGeyhJXHcNqjUhr qN79D3ub5n5qPSHRE4W+i+7v/sI1h6qzXQuAVarn3y3e8nCLA8c++7SDc9m2PXEKzzvY QYiQiyh5fwOu+dSnomLXkzPR+PWKC7qdJbDJe3qGl6NALpTb6H6hBwSuO8HNDsoKKAO9 PLj1Y/Y8R6B+iH2creY9YGHCmPnQHmp9/tLvJEcb7vMuTs3aRL/ikv9dTGLncvEq4Jkb bDVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=JbusOv72r8kUTdoIhtHh8NR/AAxzxFbgI2OrQoEu9Hg=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=im1fjwa3ZXlR0n1tz94275ImOflg1yo8U4IqwGoSVkz0zm26tyT0aKWqnELpcTxRe0 8N2pjt5EOAExzAeALcAVEyEUq/dGHfCObvI8grIRmUfSTNs8KQEoo+yMMOinjZoTgMpF sq5BHEoRVVUqQKnWYZLRZNiN8dAkkJ2mSA+l8sFI+1BZaE5B0HZ1f+uzR9lrSTvqBFWd L7vHqgso/qMf7gvUWqS1Q7FIgrsRG+c6k/IS7YyGS1011ju1E3TverRNAfDus6srnYv4 3pMOLSl9+h7bM7EIJtvaFSGSeNg14+jDHpIcaQvEa49UlhPGE+o8l7UoXsmGndteqZZa uaqg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=D8pH060q; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s13-20020a0cb30d000000b0067f047ec72bsi4827847qve.335.2023.12.15.06.38.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:38:13 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=D8pH060q; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7EFD13845159 for ; Fri, 15 Dec 2023 14:37:47 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 79D1738582BD for ; Fri, 15 Dec 2023 14:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 79D1738582BD 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 79D1738582BD Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; cv=none; b=oiRwuKT5BGI/h1qzBARHgLQNeBGnrNI3o7TtnI+03YYv9Yxr/mYP5TmjUDtI+N1wCgloZNG77J5khINtfJj/ixB3xNq2em0kjNARMl+412/mq8dzBsdlp+0JZIIUzFoQDF2iuufdEyvNEkJu15N0voS8HkVGC0kPRO43+sqywN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; c=relaxed/simple; bh=UAm/LVfIwYIRO+SIrILVnIKPc1wIlrLKeMPOcLyuE0c=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GZFTMLn+q8hDWvTLVJcXw9MgmfB3P/uH3XDQ6yh5gu0KSTDwsHtpvIUi2BUUwbqULgH1d+DdxKOa0HZPh3qoKK63LH0OQHeSwsTYjO1IvN6Wb08QZLW6TBZUcwjBdjORLtHu2GqtopP8lnVgx7Dd54UqRc/Hnv6Y1BnrpEzAAaA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEIFoN022021 for ; Fri, 15 Dec 2023 14:36: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=JbusOv72r8kUTdoIhtHh8NR/AAxzxFbgI2OrQoEu9Hg=; b=D8pH060qHdcjw7JAtDfs//wbjUlSXYS4HiPqoJ50BcZDbwZrf6fZdctxsKzhkD76OK8F oaHn/YURGzs2O9qj50DvJQEWpdDQ5gAbFl182OERaQcOB685u1kAG5QkWU+vo/lOgukH PCQo6waZkrXNX4NmuLDql6DfZrKchDXfWLWh4xX69u3JxowTAoeXR74qQYO3Or5MzF0v 9WVjOVp4gFNxWqKU+NVKjAHBulPQX1nfe/ZTpAJE4qZprOLORe3r2NDwIGImP71zbKuE CUvjavCD/Cz/CUMeexgTArNKzfBKBXmavR6xVLbztLyZR79rtcDeePTWSR/dbzQb3U4t eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0rekrf9u-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 m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFEIe6O023346 for ; Fri, 15 Dec 2023 14:36:23 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0rekrf9m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:23 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BF5tV39014813; Fri, 15 Dec 2023 14:36:22 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw42kkdau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaJYd15008432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9010820040; Fri, 15 Dec 2023 14:36:19 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63F3B20043; Fri, 15 Dec 2023 14:36:19 +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:19 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 4/7] s390: Enhance error handling in s390-mkopc Date: Fri, 15 Dec 2023 15:36:13 +0100 Message-Id: <20231215143616.820185-5-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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: N27Nt5uJAxNz-Xy7VyZ1Zmw0DOc2B31i X-Proofpoint-GUID: boxbGgkVt-N9mSalVyaBPo1ZvkVVqn5q 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 priorityscore=1501 mlxlogscore=750 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150099 X-Spam-Status: No, score=-11.9 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785359073191574131 X-GMAIL-MSGID: 1785359073191574131 When the s390-mkopc utility detects an error it prints an error message to strerr and either continues processing or exists with a non-zero return code. If it continues without detecting any further error the final return code was zero, potentially hiding the detected error. Introduce a global variable to hold the final return code and initialize it to EXIT_SUCCESS. Introduce a helper function print_error() that prints an error message to stderr and sets the final return code to EXIT_FAILURE. Use it to print all error messages. Return the final return code at the end of the processing. While at it enhance error messages to state more clearly which mnemonic an error was detected for. Also continue processing for cases where subsequent mnemonics can be processed. opcodes/ * s390-mkopc.c: Enhance error handling. Return EXIT_FAILURE in case of an error, otherwise EXIT_SUCCESS. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- opcodes/s390-mkopc.c | 49 +++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c index 5f921ee0628..aad093f18ff 100644 --- a/opcodes/s390-mkopc.c +++ b/opcodes/s390-mkopc.c @@ -21,9 +21,27 @@ #include #include +#include #include #include "opcode/s390.h" +/* Return code. */ +int return_code = EXIT_SUCCESS; + +/* Helper to print an error message and set the return code. */ +static void __attribute__ ((format (printf, 1, 2))) +print_error (const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + fprintf(stderr, "Error: "); + vfprintf(stderr, fmt, ap); + va_end(ap); + + return_code = EXIT_FAILURE; +} + struct op_struct { char opcode[16]; @@ -223,8 +241,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, if (mask_start & 3) { - fprintf (stderr, "Conditional mask not at nibble boundary in: %s\n", - mnemonic); + print_error ("Mnemonic \"%s\": Conditional mask not at nibble boundary\n", mnemonic); return; } @@ -257,7 +274,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, return; malformed_mnemonic: - fprintf (stderr, "Malformed mnemonic: %s\n", mnemonic); + print_error ("Malformed mnemonic: %s\n", mnemonic); } static const char file_header[] = @@ -343,8 +360,8 @@ main (void) cpu_string, modes_string, flags_string); if (num_matched != 6 && num_matched != 7) { - fprintf (stderr, "Couldn't scan line %s\n", currentLine); - exit (1); + print_error ("Couldn't scan line %s\n", currentLine); + exit (EXIT_FAILURE); } if (strcmp (cpu_string, "g5") == 0 @@ -385,8 +402,9 @@ main (void) || strcmp (cpu_string, "arch14") == 0) min_cpu = S390_OPCODE_ARCH14; else { - fprintf (stderr, "Couldn't parse cpu string %s\n", cpu_string); - exit (1); + print_error ("Mnemonic \"%s\": Couldn't parse CPU string: %s\n", + mnemonic, cpu_string); + goto continue_loop; } str = modes_string; @@ -401,9 +419,9 @@ main (void) mode_bits |= 1 << S390_OPCODE_ZARCH; str += 5; } else { - fprintf (stderr, "Couldn't parse modes string %s\n", - modes_string); - exit (1); + print_error ("Mnemonic \"%s\": Couldn't parse modes string: %s\n", + mnemonic, modes_string); + goto continue_loop; } if (*str == ',') str++; @@ -444,17 +462,20 @@ main (void) flag_bits |= S390_INSTR_FLAGS_CLASS_JUMPSR; str += 6; } else { - fprintf (stderr, "Couldn't parse flags string %s\n", - flags_string); - exit (1); + print_error ("Mnemonic \"%s\": Couldn't parse flags string: %s\n", + mnemonic, flags_string); + goto continue_loop; } if (*str == ',') str++; } while (*str != 0); } insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits, flag_bits); + + continue_loop: + ; } dumpTable (); - return 0; + return return_code; } From patchwork Fri Dec 15 14:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9321837dys; Fri, 15 Dec 2023 06:37:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCY5OZ/FG9DwjTaQqY7fBAgRM+0dquVHgvzvzwrQUrS/AfEF4tmzVYHHs7EzE29t07ljic X-Received: by 2002:a05:620a:2609:b0:779:d79d:196b with SMTP id z9-20020a05620a260900b00779d79d196bmr15529031qko.50.1702651052342; Fri, 15 Dec 2023 06:37:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651052; cv=pass; d=google.com; s=arc-20160816; b=PuP+gfsAx6mhu9nCTldSwabgcNb5EorKWwDT1B+Zq6hehj3l3fYWWhulBOmLebJbe7 b7WCtKO6pBcYfSBS3CyMTVUiBtWwfNPJ8Kizfaw6XFVWRZwLaCY6MlrAjsxKt4lb2FIs ++kYHkQ+6kC8XeJaZShc+XPReAC4GnX+l5AGif48EQWbXGzORE4RVmwjuYcWiDiR6oyl n7uZWmnh2PNgXfiqr0Lr904n2CJPWuEVEuQ9mhi2FOiFkpS9eHkB/rpC+VBBqbnvy9IU UU9ggvmNScU7yG9AMHHnhpoju+Ykkx7XXBRUBsZyTKh6Xijupk9q0hi48rES6Q67ABgY so/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=VnIgUWMrP7BhpaZYmhZU9AIyhLvsaNqSpdvGVI3H/rg=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=0ayjtraOC4JzfPsR7g9RHODSbh9OLiSNhWjAUvv8co+wtqWpA13aXOm+BZ6cMHALyl PF3Qx2niMLzeQye9T1MBg/Yri3+ucCH/GU42EAoPBgDfaxTawlgvHknkLA578F8Sbzqn isvfJGGjwHKZEpUpvKcbb0OGrVgrHGE8iwrS031X1Rx43y6FYR+/Yk6Gm5b8mlTJ4RUh cgDHO2zJf8vL/8QUdzhW0jP1TDxRfaioqy0mkn4IG/GaTbeIZNSIKoWVrbk5mcZn3i6z iVKnwpB8DX92wET+4+Le+QvAeES1EvsqTXjHqF5ymfXtenhGU6acdoyDcw+IAsrcQyYm Fhag== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="BB849uR/"; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j28-20020a05620a001c00b0077d8655902dsi16972639qki.726.2023.12.15.06.37.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="BB849uR/"; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 09EA5386D63B for ; Fri, 15 Dec 2023 14:37:07 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id BBF8A3856DE6 for ; Fri, 15 Dec 2023 14:36:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBF8A3856DE6 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 BBF8A3856DE6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; cv=none; b=dfqa1l2VbH9qpnqmL7q9/QfHj4GODNXNhtZTPaEQTBbLaYGH7TvzCW56WOdmcTvKUgkiMscqhoK2y3kYzWbwFvLH6uSwvJ283AR83LXvShZw+P+g0QfKyXIWJ1AIIkO/4jdGUC9nD6IgNKDkO/9lIRQxKsJX8PemwfSw6Yq1ZxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650987; c=relaxed/simple; bh=Wm7PqqWzRoD/AIwWYiq96fFHZjEGnPt/Yf5w9LYmAPk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=rcNojDpPFUNNi6FNGN2CViFzuVfddrWKgc/zsKb3pz76xB4K4CeYMu7KDr7b3e1FEhAQP3BSd8ARd4TvCrVHqQUn4CpXqTh7zuGbPS5Y8iPOY6UmctZiMbAF6ZdLnBFDlQraCuK6smpIUxN1xsFyvBlg/hrHeVWSoYqqGa/O318= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFEC5LJ018225 for ; Fri, 15 Dec 2023 14:36: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=VnIgUWMrP7BhpaZYmhZU9AIyhLvsaNqSpdvGVI3H/rg=; b=BB849uR/RKxrgdq4+XwdyminYnOgEM6XwMOUYgDE3dMBEiFcaXLgWzdnTu12UBqePrLu x4GmcS9vbLnD6G31s2mHpT+FftmvDEQP5HxldU2p17T4WN2JcUT16ZtgPFkEPD1j+9h1 NYiy48qtqF2nkI9I6Nr7TTMbNdOqlkV/8ne+etgNUUVpYFwfJsJL/ZcPm76VEZSBZ+WY 05V1p5nhTV0MT+ewAsqBAkB1vxPh2600KmyB7gguznh0lypAZUcJzeClUQIakv84u6xI 6L0WtzzSe7x4SvzCnU/sMimbbKJ3F0OGCpoDWyHyixZjsxY1maJChP/q/KZoo3M5jScr UA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0p154gcd-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 m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFECkr0022093 for ; Fri, 15 Dec 2023 14:36:23 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0p154gc9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:23 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFDlAAY012616; Fri, 15 Dec 2023 14:36:23 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw3jpgku5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:22 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3BFEaJAo15008434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Dec 2023 14:36:19 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C7FBB20040; Fri, 15 Dec 2023 14:36:19 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B9B52004B; Fri, 15 Dec 2023 14:36:19 +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:19 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 5/7] s390: Use safe string functions and length macros in s390-mkopc Date: Fri, 15 Dec 2023 15:36:14 +0100 Message-Id: <20231215143616.820185-6-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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7U57dJdtgvDKl0Jin8wZTIrbAtaAmZI_ X-Proofpoint-GUID: hoYImUmrF0z2sD2OLVr1njZWRCQgaWd1 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 mlxscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=762 lowpriorityscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150099 X-Spam-Status: No, score=-11.8 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785359029720927205 X-GMAIL-MSGID: 1785359029720927205 Use strncpy() and snprintf() instead of strcpy() and strcat(). Define and use macros for string lengths, such as mnemonic, instruction format, and instruction description. This is a mechanical change, although some buffers have increased in length by one character. This has been confirmed by verifying that the generated opcode/s390-opc.tab is unchanged. opcodes/ * s390-mkopc.c: Use strncpy() and strncat(). Suggested-by: Nick Clifton Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- opcodes/s390-mkopc.c | 77 ++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 25 deletions(-) diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c index aad093f18ff..eae0397d497 100644 --- a/opcodes/s390-mkopc.c +++ b/opcodes/s390-mkopc.c @@ -25,6 +25,19 @@ #include #include "opcode/s390.h" +#define STRINGIFY(x) _STRINGIFY(x) +#define _STRINGIFY(x) #x + +/* Length of strings without terminating '\0' character. */ +#define MAX_OPCODE_LEN 15 +#define MAX_MNEMONIC_LEN 15 +#define MAX_FORMAT_LEN 15 +#define MAX_DESCRIPTION_LEN 79 + +#define MAX_CPU_LEN 15 +#define MAX_MODES_LEN 15 +#define MAX_FLAGS_LEN 79 + /* Return code. */ int return_code = EXIT_SUCCESS; @@ -44,9 +57,9 @@ print_error (const char *fmt, ...) struct op_struct { - char opcode[16]; - char mnemonic[16]; - char format[16]; + char opcode[MAX_OPCODE_LEN + 1]; + char mnemonic[MAX_MNEMONIC_LEN + 1]; + char format[MAX_FORMAT_LEN + 1]; int mode_bits; int min_cpu; int flags; @@ -108,9 +121,12 @@ insertOpcode (char *opcode, char *mnemonic, char *format, break; for (k = no_ops; k > ix; k--) op_array[k] = op_array[k-1]; - strcpy(op_array[ix].opcode, opcode); - strcpy(op_array[ix].mnemonic, mnemonic); - strcpy(op_array[ix].format, format); + strncpy (op_array[ix].opcode, opcode, MAX_OPCODE_LEN); + op_array[ix].opcode[MAX_OPCODE_LEN] = '\0'; + strncpy (op_array[ix].mnemonic, mnemonic, MAX_MNEMONIC_LEN); + op_array[ix].mnemonic[MAX_MNEMONIC_LEN] = '\0'; + strncpy (op_array[ix].format, format, MAX_FORMAT_LEN); + op_array[ix].format[MAX_FORMAT_LEN] = '\0'; op_array[ix].sort_value = sort_value; op_array[ix].no_nibbles = no_nibbles; op_array[ix].min_cpu = min_cpu; @@ -180,9 +196,9 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, int min_cpu, int mode_bits, int flags) { char *tag; - char prefix[15]; - char suffix[15]; - char number[15]; + char prefix[MAX_MNEMONIC_LEN + 1]; + char suffix[MAX_MNEMONIC_LEN + 1]; + char number[MAX_MNEMONIC_LEN + 1]; int mask_start, i = 0, tag_found = 0, reading_number = 0; int number_p = 0, suffix_p = 0, prefix_p = 0; const struct s390_cond_ext_format *ext_table; @@ -263,12 +279,17 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, for (i = 0; i < ext_table_length; i++) { - char new_mnemonic[15]; + char new_mnemonic[MAX_MNEMONIC_LEN + 1]; - strcpy (new_mnemonic, prefix); opcode[mask_start] = ext_table[i].nibble; - strcat (new_mnemonic, ext_table[i].extension); - strcat (new_mnemonic, suffix); + + if (snprintf (new_mnemonic, sizeof (new_mnemonic), "%s%s%s", prefix, + ext_table[i].extension, suffix) >= sizeof (new_mnemonic)) + { + print_error ("Mnemonic: \"%s\": Concatenated mnemonic exceeds max. length\n", mnemonic); + return; + } + insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags); } return; @@ -338,13 +359,13 @@ main (void) make an entry into the opcode table. */ while (fgets (currentLine, sizeof (currentLine), stdin) != NULL) { - char opcode[16]; - char mnemonic[16]; - char format[16]; - char description[80]; - char cpu_string[16]; - char modes_string[16]; - char flags_string[80]; + char opcode[MAX_OPCODE_LEN + 1]; + char mnemonic[MAX_MNEMONIC_LEN + 1]; + char format[MAX_FORMAT_LEN + 1]; + char description[MAX_DESCRIPTION_LEN + 1]; + char cpu_string[MAX_CPU_LEN + 1]; + char modes_string[MAX_MODES_LEN + 1]; + char flags_string[MAX_FLAGS_LEN + 1]; int min_cpu; int mode_bits; int flag_bits; @@ -353,11 +374,17 @@ main (void) if (currentLine[0] == '#' || currentLine[0] == '\n') continue; - memset (opcode, 0, 8); - num_matched = - sscanf (currentLine, "%15s %15s %15s \"%79[^\"]\" %15s %15s %79[^\n]", - opcode, mnemonic, format, description, - cpu_string, modes_string, flags_string); + memset (opcode, '\0', sizeof(opcode)); + num_matched = sscanf (currentLine, + "%" STRINGIFY (MAX_OPCODE_LEN) "s " + "%" STRINGIFY (MAX_MNEMONIC_LEN) "s " + "%" STRINGIFY (MAX_FORMAT_LEN) "s " + "\"%" STRINGIFY (MAX_DESCRIPTION_LEN) "[^\"]\" " + "%" STRINGIFY (MAX_CPU_LEN) "s " + "%" STRINGIFY (MAX_MODES_LEN) "s " + "%" STRINGIFY (MAX_FLAGS_LEN) "[^\n]", + opcode, mnemonic, format, description, + cpu_string, modes_string, flags_string); if (num_matched != 6 && num_matched != 7) { print_error ("Couldn't scan line %s\n", currentLine); From patchwork Fri Dec 15 14:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179332 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9322456dys; Fri, 15 Dec 2023 06:38:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2H4UHR1aylWIV7syMqf1MlWoCTo8CebS4zR40+W7TfpFKE8C8jl7Fdq1FUviT07L1MtgZ X-Received: by 2002:a05:6214:5014:b0:67f:416:637c with SMTP id jo20-20020a056214501400b0067f0416637cmr7075582qvb.48.1702651110856; Fri, 15 Dec 2023 06:38:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651110; cv=pass; d=google.com; s=arc-20160816; b=e8i1VW4i5QOzhiolU99qO4n72twaZHBMwhLMfRNT6fCmd1sINS6YR//+P3klIxiBf+ Tg1rJCjVVn9oRSUzblV3vKMdk1jPUt8g6isyJxzbgfhFqXCHEcblLKISMHu0Rtob2e1P HOPR2I9FYPK5geqxp9jDKmu9hCiWc5t7JFbofwn/gu75I28MGgAEQWerQF2MRxVeAlR2 J8A3PVlNGAUslYivoaw52pyUl6x5//XK1+mfuJTF3EuCZaaJbZqjx1dSMG2jZarvC6TX zQ7pYqK/LAu6MJc2M1nXW3t4p/r4e8+ohW8CwBI58W8J2xAr9CvWZa6Ss72kihPmC4xN oAFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=bmlHJDIVL4RURhar2VumxgBop2XTqOyOsSpd6UmMfsE=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=e43kRI1rxshgmzD11W7PbWPoWF4nOB9WREzG312osrChuzzW1Wu9Fro6yNPcaW1KiS XlaO/hFC7ywzr5C/ukvR5U63vs9SEgWGSMr7t3Al/leJOJUsD6cV7h0/Onqxgw/cgtEb N6zkcGCyfWeG8vhW0yjkr/c/NDcd91GNmYKjpvpMlzDrmmht9oENPyRvp9XGWxcHRKQN z2357jKSGpIS3cVAnQ06aYSykNPlJ1Nbasrg4UmJ8WBjDHNzTsCByZavw0KA6OVKr1vF Y4ogPXJdmf8i0B+0xOtVt4bLWfc85y0hcgjyfaGk2EekQ119RcrnJmxSqWAkyQzCM2+i +6Lw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OflVA3ZS; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z17-20020a0cf011000000b0067ef83428desi1085608qvk.113.2023.12.15.06.38.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:38:30 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=OflVA3ZS; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0DC73865C2B for ; Fri, 15 Dec 2023 14:38:19 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id D16163848357 for ; Fri, 15 Dec 2023 14:36:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D16163848357 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 D16163848357 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=1702650994; cv=none; b=w0ZPX24Pnr2bNO8IYrm576tnRPhd7nbjW6Ep3g+FMVrxsmghdt2cLCb5Sx0xQTyGioKSg8Xbed6DNCw7loUqJxM+BZkCS2l7LlaHNTlBPMCo8JEGiHosFfU43t+wNlRjJPfDBgzWuqcFaWJMDLDNLwxhCm+FboE3V93EL85KDeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702650994; c=relaxed/simple; bh=Sxp7zENvCHTpAg//W4s9mbUwgXHw+JLewYeydYXJsEc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=uW5fINr4QBtybJ91xriADy1gNHUzHGLakipKMu9A0BW3Ex3Hb9FeErrhEX7M6qnxnMtbWaMf9BHKYVqsHngTh0m80vB7HoZ/S3co740ECukH2hJeMF7+kUWl6vaRL0IHtSvIbUPuu+yYBoLuEGvY13rGUDamhTOkq2rRjHC841Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3BFDvg6W000550 for ; Fri, 15 Dec 2023 14:36:31 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=bmlHJDIVL4RURhar2VumxgBop2XTqOyOsSpd6UmMfsE=; b=OflVA3ZSLoGqpSB/lHzmpqB1IibhbYz0yafv0KbB3T7wBJmT8nT65L3lvIj5s1ElI7hb 2DLc1/Mp+4wu+Gm6QLd5eCueaI2GbrAcgJh5DnH+B6ExSKVD6ZGWy9J+1JOkmD6CGYLX Dq0hxxCFj77rodwR/K504ZwUvwzKjVnJL2qV4d8Nts9bjnal/rQy7T4tp7zmk+NbK7oE t7AQ7AaL3O4DXJ+rXTMFXmlPEa0XfPOcGgvgRG5ZxGzCBkdIof+J2UZ4RT/2HS0B11kZ FNOQSTmEsRUyINArKIYFSZpKjZpvsfRVh4uMQGDx/uHa1kGekkoHYduVa9wAzh/jcW64 Sw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0r4th303-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Dec 2023 14:36:29 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3BFDwrPq004954 for ; Fri, 15 Dec 2023 14:36:28 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3v0r4th2xg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Dec 2023 14:36:28 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3BF75klO014872; Fri, 15 Dec 2023 14:36:23 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3uw42kkdaw-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 3BFEaKKJ22479364 (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 1A31820040; 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 D3C2C20043; Fri, 15 Dec 2023 14:36:19 +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:19 +0000 (GMT) From: Jens Remus To: binutils@sourceware.org Cc: Jens Remus , Andreas Krebbel , Nick Clifton Subject: [PATCH v2 6/7] s390: Optionally print instruction description in disassembly Date: Fri, 15 Dec 2023 15:36:15 +0100 Message-Id: <20231215143616.820185-7-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 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _L0dkpiHSDHS-w-K5TbQh72RrHu1smqs X-Proofpoint-ORIG-GUID: RabTt8jbYgXtZjsx6UysZMI0u1rnjkrq 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 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312150100 X-Spam-Status: No, score=-12.0 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785358968189033388 X-GMAIL-MSGID: 1785359091128489476 Print instruction description as comment in disassembly with s390 architecture specific option "insndesc": - For objdump it can be enabled with option "-M insndesc" - In gdb it can be enabled with "set disassembler-options insndesc" Since comments are not column aligned the output can enhanced for readability by postprocessing using a filter such as "expand": ... | expand -t 8,16,24,32,40,80 Or when using in combination with objdump option --visualize-jumps: ... | expand | sed -e 's/ *#/\t#/' | expand -t 1,80 Note that the instruction descriptions add about 128 KB to s390-opc.o: s390-opc.o without instruction descriptions: 216368 bytes s390-opc.o with instruction descriptions : 348432 bytes binutils/ * NEWS: Mention new s390-specific disassembler option "insndesc". include/ * opcode/s390.h (struct s390_opcode): Add field to hold instruction description. opcodes/ * s390-mkopc.c: Copy instruction description from s390-opc.txt into generated operation code table s390-opc.tab. * s390-opc.c (s390_opformats): Provide NULL as description in .insn pseudo-mnemonics opcode table. * s390-dis.c: Add s390-specific disassembler option "insndesc" and optionally print the instruction description as comment in the disassembly when it is specified. gas/ * testsuite/gas/s390/s390.exp: Add new test disassembly test case "zarch-insndesc". * testsuite/gas/s390/zarch-insndesc.s: New test case for s390- specific disassembler option "insndesc". * testsuite/gas/s390/zarch-insndesc.d: Likewise. Signed-off-by: Jens Remus Reviewed-by: Andreas Krebbel --- binutils/NEWS | 5 ++ gas/testsuite/gas/s390/s390.exp | 1 + gas/testsuite/gas/s390/zarch-insndesc.d | 17 +++++++ gas/testsuite/gas/s390/zarch-insndesc.s | 10 ++++ include/opcode/s390.h | 5 +- opcodes/s390-dis.c | 13 +++++- opcodes/s390-mkopc.c | 19 +++++--- opcodes/s390-opc.c | 62 ++++++++++++------------- 8 files changed, 92 insertions(+), 40 deletions(-) create mode 100644 gas/testsuite/gas/s390/zarch-insndesc.d create mode 100644 gas/testsuite/gas/s390/zarch-insndesc.s diff --git a/binutils/NEWS b/binutils/NEWS index 73df7053be4..35b84e62b95 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -19,6 +19,11 @@ * objdump --visualize-jumps is now supported on s390 architecture. +* The s390 disassembly now optionally includes the instruction description as + comment with the s390-specific disassembler option "insndesc": + - For objdump it can be enabled with "objdump -M insndesc ...". + - In gdb it can be enabled with "set disassembler-options insndesc". + Changes in 2.41: * The MIPS port now supports the Sony Interactive Entertainment Allegrex diff --git a/gas/testsuite/gas/s390/s390.exp b/gas/testsuite/gas/s390/s390.exp index 356fba95885..86e2dd492cd 100644 --- a/gas/testsuite/gas/s390/s390.exp +++ b/gas/testsuite/gas/s390/s390.exp @@ -37,6 +37,7 @@ if [expr [istarget "s390-*-*"] || [istarget "s390x-*-*"]] then { run_dump_test "zarch-operands" "{as -m64} {as -march=z9-109}" run_dump_test "zarch-machine" "{as -m64} {as -march=z900}" run_dump_test "zarch-optargs" "{as -m64} {as -march=arch12}" + run_dump_test "zarch-insndesc" "{as -m64}" run_list_test "machine-parsing-1" "" run_list_test "machine-parsing-2" "" run_list_test "machine-parsing-3" "" diff --git a/gas/testsuite/gas/s390/zarch-insndesc.d b/gas/testsuite/gas/s390/zarch-insndesc.d new file mode 100644 index 00000000000..9a121fb2c30 --- /dev/null +++ b/gas/testsuite/gas/s390/zarch-insndesc.d @@ -0,0 +1,17 @@ +#name: s390x insndesc +#objdump: -dr -M insndesc + +.*: +file format .* + +Disassembly of section .text: + +.* : +.*: b3 95 00 69 [ ]*cdfbr %f6,%r9 # convert from fixed 32 to long bfp + *([\da-f]+): 84 69 00 00 [ ]*brxh %r6,%r9,\1 # branch relative on index high +.*: b2 99 5f ff [ ]*srnm 4095\(%r5\) # set rounding mode +.*: b9 11 00 96 [ ]*lngfr %r9,%r6 # load negative 64<32 +.*: ec 67 92 1c 26 54 [ ]*rnsbgt %r6,%r7,18,28,38 # rotate then and selected bits and test results +.*: 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 +.*: 07 07 [ ]*nopr %r7 # no operation diff --git a/gas/testsuite/gas/s390/zarch-insndesc.s b/gas/testsuite/gas/s390/zarch-insndesc.s new file mode 100644 index 00000000000..e964315f0af --- /dev/null +++ b/gas/testsuite/gas/s390/zarch-insndesc.s @@ -0,0 +1,10 @@ +.text +foo: + cdfbr %f6,%r9 + brxh %r6,%r9,. + srnm 4095(%r5) + lngfr %r9,%r6 + rnsbgt %r6,%r7,18,28,38 + risbhgz %r6,%r7,12,13,14 + cxfbra %f5,3,%r9,7 + risbgnz %r6,%r7,12,20,14 diff --git a/include/opcode/s390.h b/include/opcode/s390.h index d540e1dfd00..319bfe2d629 100644 --- a/include/opcode/s390.h +++ b/include/opcode/s390.h @@ -81,7 +81,7 @@ enum s390_opcode_cpu_val struct s390_opcode { - /* The opcode name. */ + /* The opcode name (mnemonic). */ const char * name; /* The opcode itself. Those bits which will be filled in with @@ -110,6 +110,9 @@ struct s390_opcode /* Instruction specific flags. */ unsigned int flags; + + /* Instruction description. */ + const char * description; }; /* The table itself is sorted by major opcode number, and is otherwise diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c index 8c8a98c4e24..fca965fbb5d 100644 --- a/opcodes/s390-dis.c +++ b/opcodes/s390-dis.c @@ -31,6 +31,7 @@ static int opc_index[256]; static int current_arch_mask = 0; static int option_use_insn_len_bits_p = 0; +static int option_print_insn_desc = 0; typedef struct { @@ -43,7 +44,8 @@ static const s390_options_t options[] = { "esa" , N_("Disassemble in ESA architecture mode") }, { "zarch", N_("Disassemble in z/Architecture mode") }, { "insnlength", N_("Print unknown instructions according to " - "length from first two bits") } + "length from first two bits") }, + { "insndesc", N_("Print instruction description as comment") }, }; /* Set up index table for first opcode byte. */ @@ -63,6 +65,7 @@ disassemble_init_s390 (struct disassemble_info *info) current_arch_mask = 1 << S390_OPCODE_ZARCH; option_use_insn_len_bits_p = 0; + option_print_insn_desc = 0; for (p = info->disassembler_options; p != NULL; ) { @@ -72,6 +75,8 @@ disassemble_init_s390 (struct disassemble_info *info) current_arch_mask = 1 << S390_OPCODE_ZARCH; else if (startswith (p, "insnlength")) option_use_insn_len_bits_p = 1; + else if (startswith (p, "insndesc")) + option_print_insn_desc = 1; else /* xgettext:c-format */ opcodes_error_handler (_("unknown S/390 disassembler option: %s"), p); @@ -311,6 +316,12 @@ s390_print_insn_with_opcode (bfd_vma memaddr, else separator = ','; } + + /* Optional: instruction name. */ + if (option_print_insn_desc && opcode->description + && opcode->description[0] != '\0') + info->fprintf_styled_func (info->stream, dis_style_comment_start, "\t# %s", + opcode->description); } /* Check whether opcode A's mask is more specific than that of B. */ diff --git a/opcodes/s390-mkopc.c b/opcodes/s390-mkopc.c index eae0397d497..c6930a3e9b5 100644 --- a/opcodes/s390-mkopc.c +++ b/opcodes/s390-mkopc.c @@ -63,6 +63,7 @@ struct op_struct int mode_bits; int min_cpu; int flags; + char description[MAX_DESCRIPTION_LEN + 1]; unsigned long long sort_value; int no_nibbles; @@ -84,7 +85,7 @@ createTable (void) static void insertOpcode (char *opcode, char *mnemonic, char *format, - int min_cpu, int mode_bits, int flags) + int min_cpu, int mode_bits, int flags, char* description) { char *str; unsigned long long sort_value; @@ -132,6 +133,8 @@ insertOpcode (char *opcode, char *mnemonic, char *format, op_array[ix].min_cpu = min_cpu; op_array[ix].mode_bits = mode_bits; op_array[ix].flags = flags; + strncpy (op_array[ix].description, description, MAX_DESCRIPTION_LEN); + op_array[ix].description[MAX_DESCRIPTION_LEN] = '\0'; no_ops++; } @@ -193,7 +196,7 @@ const struct s390_cond_ext_format s390_crb_extensions[NUM_CRB_EXTENSIONS] = static void insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, - int min_cpu, int mode_bits, int flags) + int min_cpu, int mode_bits, int flags, char *description) { char *tag; char prefix[MAX_MNEMONIC_LEN + 1]; @@ -206,7 +209,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, if (!(tag = strpbrk (mnemonic, "*$"))) { - insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits, flags); + insertOpcode (opcode, mnemonic, format, min_cpu, mode_bits, flags, description); return; } @@ -290,7 +293,7 @@ insertExpandedMnemonic (char *opcode, char *mnemonic, char *format, return; } - insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags); + insertOpcode (opcode, new_mnemonic, format, min_cpu, mode_bits, flags, description); } return; @@ -311,7 +314,8 @@ static const char file_header[] = " instruction which matches.\n" " MODE_BITS - zarch or esa\n" " MIN_CPU - number of the min cpu level required\n" - " FLAGS - instruction flags. */\n\n" + " FLAGS - instruction flags.\n" + " DESCRIPTION - description of the instruction. */\n\n" "const struct s390_opcode s390_opcodes[] =\n {\n"; /* `dumpTable': write opcode table. */ @@ -337,7 +341,8 @@ dumpTable (void) op_array[ix].format, op_array[ix].format); printf ("%i, ", op_array[ix].mode_bits); printf ("%i, ", op_array[ix].min_cpu); - printf ("%i}", op_array[ix].flags); + printf ("%i, ", op_array[ix].flags); + printf ("\"%s\" }", op_array[ix].description); if (ix < no_ops-1) printf (",\n"); else @@ -497,7 +502,7 @@ main (void) str++; } while (*str != 0); } - insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits, flag_bits); + insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits, flag_bits, description); continue_loop: ; diff --git a/opcodes/s390-opc.c b/opcodes/s390-opc.c index cbfdb3df0b7..e44621a7479 100644 --- a/opcodes/s390-opc.c +++ b/opcodes/s390-opc.c @@ -774,37 +774,37 @@ unused_s390_operands_static_asserts (void) const struct s390_opcode s390_opformats[] = { - { "e", OP8(0x00LL), MASK_E, INSTR_E, 3, 0 ,0 }, - { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3, 0 ,0 }, - { "rie", OP8(0x00LL), MASK_RIE_RRP, INSTR_RIE_RRP, 3, 0 ,0 }, - { "ril", OP8(0x00LL), MASK_RIL_RP, INSTR_RIL_RP, 3, 0 ,0 }, - { "rilu", OP8(0x00LL), MASK_RIL_RU, INSTR_RIL_RU, 3, 0 ,0 }, - { "ris", OP8(0x00LL), MASK_RIS_RURDI, INSTR_RIS_RURDI, 3, 6 ,0 }, - { "rr", OP8(0x00LL), MASK_RR_RR, INSTR_RR_RR, 3, 0 ,0 }, - { "rre", OP8(0x00LL), MASK_RRE_RR, INSTR_RRE_RR, 3, 0 ,0 }, - { "rrf", OP8(0x00LL), MASK_RRF_RURR, INSTR_RRF_RURR, 3, 0 ,0 }, - { "rrs", OP8(0x00LL), MASK_RRS_RRRDU, INSTR_RRS_RRRDU, 3, 6 ,0 }, - { "rs", OP8(0x00LL), MASK_RS_RRRD, INSTR_RS_RRRD, 3, 0 ,0 }, - { "rse", OP8(0x00LL), MASK_RSE_RRRD, INSTR_RSE_RRRD, 3, 0 ,0 }, - { "rsi", OP8(0x00LL), MASK_RSI_RRP, INSTR_RSI_RRP, 3, 0 ,0 }, - { "rsy", OP8(0x00LL), MASK_RSY_RRRD, INSTR_RSY_RRRD, 3, 3 ,0 }, - { "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3, 0 ,0 }, - { "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3, 0 ,0 }, - { "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR, 3, 0 ,0 }, - { "rxy", OP8(0x00LL), MASK_RXY_RRRD, INSTR_RXY_RRRD, 3, 3 ,0 }, - { "s", OP8(0x00LL), MASK_S_RD, INSTR_S_RD, 3, 0 ,0 }, - { "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3, 0 ,0 }, - { "siy", OP8(0x00LL), MASK_SIY_URD, INSTR_SIY_URD, 3, 3 ,0 }, - { "sil", OP8(0x00LL), MASK_SIL_RDI, INSTR_SIL_RDI, 3, 6 ,0 }, - { "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD, 3, 0 ,0 }, - { "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3, 0 ,0 }, - { "ssf", OP8(0x00LL), MASK_SSF_RRDRD, INSTR_SSF_RRDRD, 3, 0 ,0 }, - { "vrv", OP8(0x00LL), MASK_VRV_VVXRDU, INSTR_VRV_VVXRDU, 3, 9 ,0 }, - { "vri", OP8(0x00LL), MASK_VRI_VVUUU, INSTR_VRI_VVUUU, 3, 9 ,0 }, - { "vrx", OP8(0x00LL), MASK_VRX_VRRDU, INSTR_VRX_VRRDU, 3, 9 ,0 }, - { "vrs", OP8(0x00LL), MASK_VRS_RVRDU, INSTR_VRS_RVRDU, 3, 9 ,0 }, - { "vrr", OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 3, 9 ,0 }, - { "vsi", OP8(0x00LL), MASK_VSI_URDV, INSTR_VSI_URDV, 3, 10 ,0 }, + { "e", OP8(0x00LL), MASK_E, INSTR_E, 3, 0, 0, NULL }, + { "ri", OP8(0x00LL), MASK_RI_RI, INSTR_RI_RI, 3, 0, 0, NULL }, + { "rie", OP8(0x00LL), MASK_RIE_RRP, INSTR_RIE_RRP, 3, 0, 0, NULL }, + { "ril", OP8(0x00LL), MASK_RIL_RP, INSTR_RIL_RP, 3, 0, 0, NULL }, + { "rilu", OP8(0x00LL), MASK_RIL_RU, INSTR_RIL_RU, 3, 0, 0, NULL }, + { "ris", OP8(0x00LL), MASK_RIS_RURDI, INSTR_RIS_RURDI, 3, 6, 0, NULL }, + { "rr", OP8(0x00LL), MASK_RR_RR, INSTR_RR_RR, 3, 0, 0, NULL }, + { "rre", OP8(0x00LL), MASK_RRE_RR, INSTR_RRE_RR, 3, 0, 0, NULL }, + { "rrf", OP8(0x00LL), MASK_RRF_RURR, INSTR_RRF_RURR, 3, 0, 0, NULL }, + { "rrs", OP8(0x00LL), MASK_RRS_RRRDU, INSTR_RRS_RRRDU, 3, 6, 0, NULL }, + { "rs", OP8(0x00LL), MASK_RS_RRRD, INSTR_RS_RRRD, 3, 0, 0, NULL }, + { "rse", OP8(0x00LL), MASK_RSE_RRRD, INSTR_RSE_RRRD, 3, 0, 0, NULL }, + { "rsi", OP8(0x00LL), MASK_RSI_RRP, INSTR_RSI_RRP, 3, 0, 0, NULL }, + { "rsy", OP8(0x00LL), MASK_RSY_RRRD, INSTR_RSY_RRRD, 3, 3, 0, NULL }, + { "rx", OP8(0x00LL), MASK_RX_RRRD, INSTR_RX_RRRD, 3, 0, 0, NULL }, + { "rxe", OP8(0x00LL), MASK_RXE_RRRD, INSTR_RXE_RRRD, 3, 0, 0, NULL }, + { "rxf", OP8(0x00LL), MASK_RXF_RRRDR, INSTR_RXF_RRRDR, 3, 0, 0, NULL }, + { "rxy", OP8(0x00LL), MASK_RXY_RRRD, INSTR_RXY_RRRD, 3, 3, 0, NULL }, + { "s", OP8(0x00LL), MASK_S_RD, INSTR_S_RD, 3, 0, 0, NULL }, + { "si", OP8(0x00LL), MASK_SI_URD, INSTR_SI_URD, 3, 0, 0, NULL }, + { "siy", OP8(0x00LL), MASK_SIY_URD, INSTR_SIY_URD, 3, 3, 0, NULL }, + { "sil", OP8(0x00LL), MASK_SIL_RDI, INSTR_SIL_RDI, 3, 6, 0, NULL }, + { "ss", OP8(0x00LL), MASK_SS_RRRDRD, INSTR_SS_RRRDRD, 3, 0, 0, NULL }, + { "sse", OP8(0x00LL), MASK_SSE_RDRD, INSTR_SSE_RDRD, 3, 0, 0, NULL }, + { "ssf", OP8(0x00LL), MASK_SSF_RRDRD, INSTR_SSF_RRDRD, 3, 0, 0, NULL }, + { "vrv", OP8(0x00LL), MASK_VRV_VVXRDU, INSTR_VRV_VVXRDU, 3, 9, 0, NULL }, + { "vri", OP8(0x00LL), MASK_VRI_VVUUU, INSTR_VRI_VVUUU, 3, 9, 0, NULL }, + { "vrx", OP8(0x00LL), MASK_VRX_VRRDU, INSTR_VRX_VRRDU, 3, 9, 0, NULL }, + { "vrs", OP8(0x00LL), MASK_VRS_RVRDU, INSTR_VRS_RVRDU, 3, 9, 0, NULL }, + { "vrr", OP8(0x00LL), MASK_VRR_VVV0UUU, INSTR_VRR_VVV0UUU, 3, 9, 0, NULL }, + { "vsi", OP8(0x00LL), MASK_VSI_URDV, INSTR_VSI_URDV, 3, 10, 0, NULL }, }; const int s390_num_opformats = From patchwork Fri Dec 15 14:36:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Remus X-Patchwork-Id: 179334 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9323326dys; Fri, 15 Dec 2023 06:40:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/rf+voMscjUbz8eaX55Uf9rBJx7w8a7dn91xIE2xoAlmeeVs44Xg3+wcefwj+wj21+K7r X-Received: by 2002:a05:6871:28a3:b0:1fb:75c:400a with SMTP id bq35-20020a05687128a300b001fb075c400amr13244342oac.106.1702651201281; Fri, 15 Dec 2023 06:40:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702651201; cv=pass; d=google.com; s=arc-20160816; b=a449dR3hcnr1H1eI662mTJTmQyUWnHmMjJPjcVblXmWOoXIpFBMneMUqdcqQ7fuYJO eWyF38DvE1T0wktFD9h3bPXcow5FZlLH+CNqmyTRQpBg24EcBRdLTfW9FKeqQUr+Wf/d pukKaaCTfs49rYArDOiBfbfR8iIx5oMh7Q+91w3Zn4G/TKK2g2/k8ZZSp3YFwnqHYQ8y OqH9Tpz+pbWCMSVKXCV/pmhRMMFS/3R2AE4DqamtGwKuMmf55PT/SAu4QkvwUvteeZox Ex28x9ypl2bab6MOa3PYZQDlC91Qx5sQmYeZ8P6YMcLfD6qpozPIn8BmBF1Qc4nVBhRM AAyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=9s0iz1jBANxI4WOw6n+ZaH1+OvLMMUwLEgrRtQFeOFc=; fh=lE3HXkiifBSVPU+f05x++3qNjjxlDvLZxwnRCBzavKo=; b=Bx0uQ2TIRdHe9jX71VoqeKY2tGqb9FcOe9V2MFt3bxInLAvKZDWHgxSk7h9GscvIR2 1VILtBSXAuXUSpu0N7meJJEhhIBFI7V/JtnkYnSHrV7AvflbilZTji/MRngPdIxbBIgl DAEoVhtq0RwXSA89l0PW5/pDQfyMFSHmY1bsq4FAdJ1SEnBFc1d8mXqqv6dm+oVKT6Jn LQrkzbfUpdxYH9vFbX97OVN5P8UbhcCpOmh1qZg5SQCtQ1bD+9xZH1zvnNXe6Pln1FA6 ptfcbRRNOAci5mHxq+M791exF+bZGtj3cQCrSQ4a5mu3upDmkGvTTfIJQpTb3OYKUswu bJ4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SwJdM02u; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s3-20020a05620a29c300b007759f94721asi15699193qkp.209.2023.12.15.06.40.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 06:40:01 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=SwJdM02u; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F33A63847820 for ; Fri, 15 Dec 2023 14:40:00 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785359185967618286 X-GMAIL-MSGID: 1785359185967618286 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;