From patchwork Sat Jan 7 15:47:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guillermo E. Martinez" X-Patchwork-Id: 40415 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1350651wrt; Sat, 7 Jan 2023 07:48:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXuTWxcRp/f3YPXQgBPDKGcri4r4xwvLTI7WtsozhvKZNgnzy8HA9aXxbqYbtrbauUvCkEav X-Received: by 2002:a17:906:c0ce:b0:7ad:d7a4:4346 with SMTP id bn14-20020a170906c0ce00b007add7a44346mr61592103ejb.66.1673106484184; Sat, 07 Jan 2023 07:48:04 -0800 (PST) Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ji13-20020a170907980d00b007c0a70496desi4221726ejc.724.2023.01.07.07.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 07:48:04 -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=@sourceware.org header.s=default header.b=lyybOkOv; arc=fail (signature failed); 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=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A0EF3858408 for ; Sat, 7 Jan 2023 15:48:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A0EF3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673106483; bh=luB7cwV0+DQ7oDK+RRpHigrTYSa9onTSYUsyc2wTl04=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=lyybOkOvTSh+KpQSKKeVReA9QzfGilZQQhzwU65zzJ/xP2Uqx3RgisnwA0T2EmHrm xovR7QcCl1/A2j17WlpP/O9zXpRYvswZG0lu1JwnVtQxGvVfLRWIgA/bGXLvDdD2lA 92NvIwCeMBCOifyjJ1ZtLlR4Nh6yBuQ5U1tCBd7U= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 1CA7D3858D35 for ; Sat, 7 Jan 2023 15:47:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CA7D3858D35 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 307FZVmf011725 for ; Sat, 7 Jan 2023 15:47:53 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my19tgefq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 07 Jan 2023 15:47:52 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 307AYPIK017916 for ; Sat, 7 Jan 2023 15:47:52 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mxy62erbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 07 Jan 2023 15:47:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVwMNr/ZXFSQhzWrpt2w4KHEpCLiTVOM+Tf2AAs48g76pUR5o6AyPU6OP37dw4DpBjvholTXSOqV3hxTiAJbzcrvpU4aKU6YdhMuudPU8rMBcn0OwjesGcv5LqbMddt+/VAW8hl+G+GBDM0cECZTcexPC+97ln5Zab38BbE4TCqUXfZGSuhoobjdHDKzb5cej6JV46uqOUPQ8AGV3c7fvAkIKMv4Ruy35dVxe5t+R0w/SmtVXq+pWA2K+oHg+59Fm3zQ7LJJOQTMH8XQHpK23a1H9zsIq3V1txoKsbniOc7jFpLmyb2WzbnGcssXS9BlvQOHqWTux2CVKPxdM/5NTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=luB7cwV0+DQ7oDK+RRpHigrTYSa9onTSYUsyc2wTl04=; b=X6xUESiUWKjZsT15ilJCPs655vYXAXG8VrlM4OuuTnKj6Wke7tibnlaoWs/kb+f8SqxnhVzT/89tr6RH+o3g0S1F/I9q7SbDOnT0UNMypdQF8PPckM+OJZdphJ3IJCSaO5GZv37onjyUehZlprJ1HmPlRvkvhua7J/aTFX/HdGIw6hwX3XbkfPJxQ2OhW40vmNRRmIIq4t2hhcQPjiTYkGTocbEEKihyxS3YgsRVTgOT+qKkrp0B5I4hyW45QaBzkci50i47+b2RYPWQc7PVL/tI6tp4xVm2BMICPi+a/0PwCAu2Ex0ILkZxW6jMez8z5rEof7TY+AHuOLBFBvW0Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) by CH2PR10MB4248.namprd10.prod.outlook.com (2603:10b6:610:7e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.23; Sat, 7 Jan 2023 15:47:49 +0000 Received: from MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::70df:cb31:cf08:5b12]) by MWHPR10MB1407.namprd10.prod.outlook.com ([fe80::70df:cb31:cf08:5b12%9]) with mapi id 15.20.6002.009; Sat, 7 Jan 2023 15:47:48 +0000 To: binutils@sourceware.org Cc: jose.marchesi@oracle.com, "Guillermo E. Martinez" Subject: [PATCH] bpf: fix error conversion from long unsigned int to unsigned int [-Werror=overflow] Date: Sat, 7 Jan 2023 09:47:43 -0600 Message-Id: <20230107154743.624854-1-guillermo.e.martinez@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230106075816.387489-1-guillermo.e.martinez@oracle.com> References: <20230106075816.387489-1-guillermo.e.martinez@oracle.com> X-ClientProxiedBy: SN7PR04CA0220.namprd04.prod.outlook.com (2603:10b6:806:127::15) To MWHPR10MB1407.namprd10.prod.outlook.com (2603:10b6:300:23::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR10MB1407:EE_|CH2PR10MB4248:EE_ X-MS-Office365-Filtering-Correlation-Id: 8acd64e5-c672-4c52-68af-08daf0c686bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v4HTUYQVAunhwqBnRqY/AKVoe+ttXQkMfC0SJt0xQdyMy6beIVfE5SnKIsD88REmoqOPlDQ6tNanUXJ1kk9zJvMuo2//2ToqOmxcLXcWPW0ZPtpDvM2slrmpGozzuIXlfYoVSQDSIfkwVI4vc7UmJG5580+rUl9JNoCniAzRDzTGid3Bjii3Jn9W9tbTixIjLWHfRZv0HPbqOv5Zpw/qNyFNXTPngEUPGHNy468YvC0P4DVX/BAjBG/+YMgpRRevVtwZEu1f19h8rqcSB01aYvirOBgyv65QMwWG+10m/8dHkP9UDlBGgE1iZc82gjtlnTAeeLy7Pq+eCD8Q6dn9pYcY+jdFrM1ywKfFuO2/3aPhg+LP2w3vovStpEtbzlBe9F0AHFwFFXarSGVRfXuTnujgkKkC9tOXJFtx6rzKQJvf8BIXoRDn9ZIY5sNWSPIyWa+pyJG9kQZXDiX+WG4NrPuf4I1j9zfBtfk0CuEspGPj/bXPDcEnThi99fcGC+wE/7SfPlu5G/3TKWhNauiqddxIQJIUQoaiGPhZh91TpNx/DapWFN7dzi8s5FF0kjIGAx6p2m/m06GCa23M1yWl8/M7aO5H0/+jQeS24H9H6RPxJ474hBo8HqAVr0UObys+yRgXlF2KNbJB/o86XZDBMg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR10MB1407.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(136003)(366004)(346002)(396003)(39860400002)(451199015)(107886003)(6506007)(6486002)(6666004)(316002)(186003)(6512007)(103116003)(6916009)(4326008)(66946007)(66476007)(30864003)(8676002)(1076003)(2616005)(66556008)(5660300002)(38100700002)(83380400001)(86362001)(478600001)(8936002)(36756003)(2906002)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2tjtjdlQRjN5q3I6BTcjx+UnoE+e?= =?utf-8?q?iHW68xnfUeLhJf23AdY6/556VQHPy+G93ciianjMAbrxrZyrTqKVrmR5yI/40eGa8?= =?utf-8?q?sv3P16kSbNvoLFFqrZ266QYJsKLfdgAz/FPz4lcis0o0AeNHekShuxw6Fm/5od1ft?= =?utf-8?q?5tCsZMkLlWuOAE+D58CkT5QFGz9vBEegyA+GSPnzpT4GPCI4CG2jf58GQEH0sl5An?= =?utf-8?q?U7YwW6JSY5OOSWg7Hgn0mEwhODP+N7fZHOeZ1OsX/cpmqj+IfvjMAKTAuIuFimp0n?= =?utf-8?q?q/mR3d3vsjR2v3pfz0hVm8BhBKYfUPUE1kpEbxOfz++MkBBFIwTXgiySdvbqJXgbn?= =?utf-8?q?1oWTzkiwEg6E0aXI/b9Foy7i/JC5v7XeKQBKLisYAmwi8SXqokz1leJTpdnhO2ZAv?= =?utf-8?q?aXsxDQ/Qcq4YMBChTj3ExeEZKLrQ6m4XXfjKC/5SIvPDelw/Sm/SBO1AwPpG2W42q?= =?utf-8?q?bwcaQgzxd3MHCjwxEe76TIPmy5PJZqepsWfIinSemCDnJaF8VHVa42UMAOmtat+bH?= =?utf-8?q?Cz3YW/BbWbVqsz5f0aeCTsXT//IbH2IvaSA9GYc3AurAIxq9dvLklnqVa4qRsAGN1?= =?utf-8?q?oYWQWH/SBC/xZINJF1Mc846JAOOlV2hkoREC2jNQhJa5ufKczxJMCF+1Tc0CXYjcv?= =?utf-8?q?pJ80y75x+mhdt1cbJ6y+4Xi34R82nlsviaiusLa0zXePiAPYxjRS/dIN/i+pN1uFM?= =?utf-8?q?Le340e0McKBe+Iu2PegJcCqGNhgAiZCLw0yKpQbUr9If8yeKIFJkEJa7+VDWE2T74?= =?utf-8?q?TKgzQyspOQsA7hVTp/r0uSxbNIzLuI2sUCSFt/JbmZ77bp+T/dPY2qJX5u7tE0CJv?= =?utf-8?q?LoVGtkQBXorvWS2NDNucbnt4JctFN3gpN64Y4MI8TxFaZ6Fl34WnXuY8QXiNHIuMC?= =?utf-8?q?r8H9euR9AU2O0o23Arll/ZuHz1UqmjuJYeJjue4NEo0t/IMrKrmAt//DIMrjU0C9I?= =?utf-8?q?I6OcKeRuiPqZlvv1zB3JTP0UZydqc/jTM0cyIgHeOs8XJ+v9HIcErZM3e0Agl94A/?= =?utf-8?q?RxQ+KUYayR/UBZr2KXG8bHmnhcl9ZZpXNKhChsluRo09TPhUf3wL9NXpPOlyCIMrV?= =?utf-8?q?wK+AieiLPBx/Va5SsPJ6BnWXknBN8kenevWPnTq1c8y3hntryKeLv7a76pF6RwuOI?= =?utf-8?q?XFHXYSQCTf68foUYbjCorfTZJqlcsYdeBUUjLMhyjXLZ5otzwjna8kO6eaj2a/Y3s?= =?utf-8?q?mJD033ZwpYcRB8mik/ic/Peke8+mesmmJkMrPf9ATUVtEpxnBKGG6SoYsvDT2QNQT?= =?utf-8?q?7DaMUdCn0lqJxRSTJw4LQDTchyhg8nINM8EmHaUAcQn+iLgt1EF+up85N44zSd1tC?= =?utf-8?q?jJeafT4AuEXbWoL2/vbGTax/OQRsJGs/g3EXlBPGGji7qjt4O4xwe6LrytwORodqc?= =?utf-8?q?KId2si8cN4NjacF+i127Kl7BUhdcbO5SVNsU8Ia9m6JXSCZ4jdJ3cDYAugAkvXtrA?= =?utf-8?q?ukUt68RMy0IrliFUVo8AhfsefSG1nhOAG2IdipwjiNeUV3CNdqoNEIPgV7tZIGEdd?= =?utf-8?q?VeVBNoqDzrSQm2lvdta0rrTBBU9Hazm6xEslq23OqzX9aPSjpZqX2V0gZh3hNDoQo?= =?utf-8?q?2q5aXtUIJihedXOrdCocHpFbwQdh5W1sATE+d6Iy1/d0PZs0uVG18c=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: CcJWu8qU+7g9jVU+CVLVhqsYeI1+FmHetH3yGEGMXL3QCk33qnWewnCDKlUDzUqAiUJfI/uq7QLjKYFSLW/3h1nxIASA3739V0QYRg0Jhq0JgfKxR8ZuT7DvUOobQbg6II3GHE3uKvHOShlONiBATuqOq8Ab3m5L2s+Faz8U1hELp1ehC4y+BxmtDz1JJvZoq1CHkurt8tf5wDmNEy1GpjV6+uW7yIYN8GzmtOIQVcY0XsLf0SdY8PDy8aabIHKB0NGO1lTNUOrTSUjVSh7Tfaas+7aS7GATlW8SyvXp0nPXTm4GL1wZy8it83Zw/wxLif24aKeZjEDgvZaZebVYEKSgd9KiGAMe050Pe1+tHL3aJfl+0syKOZpq2LNz6iQyLjGpZmP7bpBbelvmexa87X5chlBiQmm8l+lAjoiykovUlDERLMNHw3XTTDoFfOWvnXNY+DlxIBq01CHzw4qWEJoKBYc4wzzra4cNyTIZs0cEky+Z2WPv+ZYA/JFRaEJFyvpIo8rNTIddDA+DkDUAgF/g2fQ0hPreAVICJui7+Ni27URG1Jtjiai4ma2nlqEXzpQaWdW4ktmsIL2MGFiIxqaL/OsJAydNqLMZTdOfKCP6gjY2+zEZ/sSLFas3KUz3G1FS/DenyyMjmWEFeFWuiZ7skoI87qBGaXmUhjpcu2qA3GwiCvjT2589Q/VjsgkwfE812nPnqB0UBpAYTqcEPXUsYV8lech5tzZhUhxfLWUPOVlm7MFLHQYzszwA63UE X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8acd64e5-c672-4c52-68af-08daf0c686bd X-MS-Exchange-CrossTenant-AuthSource: MWHPR10MB1407.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2023 15:47:48.6565 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +kvui6yNUguIpMFNPKZqEZl77ZsDeQCx8v4kAos3LE3KwEtSl8ZoUom+PcScD+d28Gh2dZDbQDebd7vUfnL67THYKpswq1oVAoy8PpTnfd4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4248 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-07_06,2023-01-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=769 spamscore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301070122 X-Proofpoint-ORIG-GUID: KttOPzmiC1MkwsL4cpf3lri5iSJSMewC X-Proofpoint-GUID: KttOPzmiC1MkwsL4cpf3lri5iSJSMewC X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Guillermo E. Martinez via Binutils" From: "Guillermo E. Martinez" Reply-To: "Guillermo E. Martinez" Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754259161697089581?= X-GMAIL-MSGID: =?utf-8?q?1754379304352811750?= This is patch-v2 meant to fix compiling errors when maintainer mode is enable to BPF target. Changes from v1: + Adjust type for mask bit width in cgen-dis.c. + Looking for regressions on 134 CGEN targets. + Tweak change log message. Please let me know your comments, I'll really appreciate them. Kind regards, guillermo --- Regenerating BPF target using the maintainer mode emits: .../opcodes/bpf-opc.c:57:11: error: conversion from ‘long unsigned int’ to ‘unsigned int’ changes value from ‘18446744073709486335’ to ‘4294902015’ [-Werror=overflow] 57 | 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } The use of a narrow size to handle the mask CGEN in instruction format is causing this error. Additionally eBPF `call' instructions constructed by expressions using symbols (BPF_PSEUDO_CALL) emits annotations in `src' field of the instruction, it's used to identify BPF target endianness. Regression tests to the following targets were done: bpf arm-linuxeabi arm-nacl arm-netbsdelf arm-nto arm-pe arm-symbianelf arm-vxworks arm-wince-pe aarch64-linux alpha-dec-vms alpha-linux alpha-linuxecoff alpha-netbsd alpha-unknown-freebsd4.7 am33_2.0-linux arc-linux-uclibc avr-elf bfin-elf cr16-elf cris-elf crisv32-linux crx-elf d10v-elf d30v-elf dlx-elf epiphany-elf fr30-elf frv-elf frv-linux ft32-elf h8300-elf hppa-linux hppa-hp-hpux10 hppa64-hp-hpux11.23 hppa64-linux mips-linux mips-vxworks mips64-linux mipsel-linux-gnu mipsisa32el-linux mips64-openbsd mipstx39-elf ia64-elf ia64-freebsd5 ia64-hpux ia64-linux ia64-netbsd ia64-vms ip2k-elf iq2000-elf lm32-elf m32c-elf m32r-elf m68hc11-elf m68hc12-elf m68k-elf m68k-linux m68k-netbsd mcore-elf mcore-pe mep-elf metag-linux microblaze-elf mmix mn10200-elf mn10300-elf moxie-elf ms1-elf msp430-elf mt-elf nds32le-elf nios2-linux or1k-elf pdp11-dec-aout pj-elf powerpc-eabisim powerpc-eabivle powerpc-linux powerpc-nto powerpc-wrs-vxworks powerpc64-linux powerpcle-cygwin powerpcle-elf powerpc64le-linux ppc-lynxos pru-elf riscv32-elf riscv64-elf rl78-elf rs6000-aix4.3.3 rs6000-aix5.1 rx-elf s390-linux s390x-linux score-elf sh-linux sh-nto sh-pe sh-rtems sh-vxworks shl-unknown-netbsdelf sparc-aout sparc-linux sparc-vxworks sparc64-linux sparc-sun-solaris2.12 spu-elf tic30-unknown-aout tic30-unknown-coff tic4x-coff tic54x-coff tic6x-elf tilegx-linux tilepro-linux v850-elf vax-netbsdelf visium-elf i386-darwin i386-lynxos i586-linux i686-nacl i686-pc-beos i686-pc-elf i686-pe i686-vxworks x86_64-linux x86_64-w64-mingw32 x86_64-nacl xgate-elf xstormy16-elf xtensa-elf z8k-coff z80-coff. cpu/ * bpf.cpu (define-call-insn): Add `src' operand field to the instruction. include/ *opcode/cge.h (CGEN_IFMT): Adjust mask bit width. opcodes/ * cgen-dis.c (count_decodable_bits): Adjust type for mask bit width. * bpf-opc.c: Regenerate. --- cpu/bpf.cpu | 2 +- include/opcode/cgen.h | 2 +- opcodes/bpf-opc.c | 54 +++++++++++++++++++++++-------------------- opcodes/cgen-dis.c | 2 +- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/cpu/bpf.cpu b/cpu/bpf.cpu index 13dde7094c8..2ae74fc4c18 100644 --- a/cpu/bpf.cpu +++ b/cpu/bpf.cpu @@ -768,7 +768,7 @@ "call" (endian-isas x-endian) "call $disp32" - (+ disp32 (f-offset16 0) (f-regs 0) + (+ disp32 (f-offset16 0) (.sym src x-endian) ((.sym f-dst x-endian) 0) OP_CLASS_JMP OP_SRC_K OP_CODE_CALL) (c-call VOID "bpfbf_call" disp32 (ifield (.sym f-src x-endian))) diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h index 36b88f1b5fe..6c0732b4b25 100644 --- a/include/opcode/cgen.h +++ b/include/opcode/cgen.h @@ -914,7 +914,7 @@ typedef struct Each insn's value is stored with the insn. The first step in recognizing an insn for disassembly is (opcode & mask) == value. */ - CGEN_INSN_INT mask; + CGEN_INSN_LGUINT mask; #define CGEN_IFMT_MASK(ifmt) ((ifmt)->mask) /* Instruction fields. diff --git a/opcodes/bpf-opc.c b/opcodes/bpf-opc.c index a6d8a7dd3ca..1cc06f7cbf6 100644 --- a/opcodes/bpf-opc.c +++ b/opcodes/bpf-opc.c @@ -50,99 +50,103 @@ static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = { }; static const CGEN_IFMT ifmt_addile ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_addrle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_negle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfffffffffffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_addibe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_addrbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffffffff00ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_negbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffffffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_endlele ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_endlebe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_lddwle ATTRIBUTE_UNUSED = { - 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 128, 0xfffff0ff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_lddwbe ATTRIBUTE_UNUSED = { - 64, 128, 0xff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 128, 0xffff0fff, { { F (F_IMM64) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ldabsw ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ldindwle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ldindwbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ldxwle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ldxwbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_stble ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_DSTLE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_stbbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_MODE) }, { F (F_OP_SIZE) }, { F (F_SRCBE) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_jeqile ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xf0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_jeqrle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_jeqibe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xfff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_jeqrbe ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff000000ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_callle ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffff0fff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_SRCLE) }, { F (F_OP_CODE) }, { F (F_DSTLE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_callbe ATTRIBUTE_UNUSED = { + 64, 64, 0xfffff0ff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_DSTBE) }, { F (F_OP_CODE) }, { F (F_SRCBE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_ja ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffff0000ffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; static const CGEN_IFMT ifmt_exit ATTRIBUTE_UNUSED = { - 64, 64, 0xff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } + 64, 64, 0xffffffffffffffff, { { F (F_IMM32) }, { F (F_OFFSET16) }, { F (F_REGS) }, { F (F_OP_CODE) }, { F (F_OP_SRC) }, { F (F_OP_CLASS) }, { 0 } } }; #undef F @@ -1646,7 +1650,7 @@ static const CGEN_OPCODE bpf_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DISP32), 0 } }, - & ifmt_callle, { 0x85 } + & ifmt_callbe, { 0x85 } }, /* call $dstle */ { diff --git a/opcodes/cgen-dis.c b/opcodes/cgen-dis.c index de315d90cfc..90746a845ed 100644 --- a/opcodes/cgen-dis.c +++ b/opcodes/cgen-dis.c @@ -39,7 +39,7 @@ static void add_insn_to_hash_chain (CGEN_INSN_LIST *, static int count_decodable_bits (const CGEN_INSN *insn) { - unsigned mask = CGEN_INSN_BASE_MASK (insn); + CGEN_INSN_LGUINT mask = CGEN_INSN_BASE_MASK (insn); #if GCC_VERSION >= 3004 return __builtin_popcount (mask); #else