From patchwork Mon Feb 13 17:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Matz X-Patchwork-Id: 56404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2478865wrn; Mon, 13 Feb 2023 09:43:09 -0800 (PST) X-Google-Smtp-Source: AK7set+/dVbzESGRzDHC2JQ2TS3nOiEXRxV2gchgft3Jk3S+Mg2p+hG9sYa8y7kZ2Gv5aRi2yUsP X-Received: by 2002:a50:d518:0:b0:49e:4786:a0e2 with SMTP id u24-20020a50d518000000b0049e4786a0e2mr7211887edi.14.1676310189263; Mon, 13 Feb 2023 09:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676310189; cv=none; d=google.com; s=arc-20160816; b=d/9Ew/4kWWpXYB4M1F6MfAxRVeWhmke+QYPaa56FUctja1w8ruMYFLBl8y42OWNSfH Kdd16qhK4GsaY3yCW6+bvOv8HMgkI29/qfonVUskpTzqzOklu4xaltCbKA6StqQ1vpEX 6gn6EC4B6JPFCVEiU6WRGrf6ivJaK8f+/gxB8At2llrs2/rIrxydl9CNFmruscBH6MMR SiJGLaefqGMluTNHxyuTLPTdf713pcPtLyEIUdOpzawjuf9yI3LWJUpuX0fNMboRTEt1 TNJO6rrTKBARpQoE3E0c6xMEwUKKGcZjzWZ8pcwcAPwnXaI8sC9uqDU/uFo10X2r5Sxa CrNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=ghzb8lO/QR9LbwA3iLiDQeqG8575PxCkbmb9qWu95/c=; b=uzTl2qpT3v8nFXR7i0VJbWOqzk0FI/gqWG4s22zAovm8P396VyXA8FsYbhqdZzhQ9j Veg4KVZdN/UEaA0J3Re5Y9WrBPm/uzQOj2N4/WYK4DqJGPp2Iv0XFR9s1vQSrjooOIIE JLu5aEG2BHiETl0EZzn5acS/k/8zUjhRpf3Lt+ZAmWBbzHbNIrqLutKYPlVT6QarmR3Z 5MKw3Wf+yx7HMSTgK18ji0Mp82Xx1mRfcSCuRKRnZeqqllk5rM0CUCbYeo/te1mo1Zac hNeaVYbjXFrBdddWHdy6H0vkBSTOVUb5BC+mTm9w9iy+dryPlA0XBXKv8YarMe5pSHbd KTIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="QTguP/qa"; 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 sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l6-20020aa7c3c6000000b004ab250bced9si12688293edr.635.2023.02.13.09.43.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 09:43:09 -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="QTguP/qa"; 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 4AE45385B53B for ; Mon, 13 Feb 2023 17:43:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AE45385B53B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676310188; bh=ghzb8lO/QR9LbwA3iLiDQeqG8575PxCkbmb9qWu95/c=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QTguP/qa1eEuUrT/izNGQ7maIFLjf3FrTifskA1xyZfFerx6zUzQ1f4GaBBRXRikc kmL5xC5ixi5h/Lif/NnIB+TndtblSxdgW84RcHpMBhGq/83384h04hZbXBk7RXH9Qx SEBbl3qzwuNi4QDskp7TxXdej5eWUUa7GFPsbBTQ= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 9B8033858404 for ; Mon, 13 Feb 2023 17:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B8033858404 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7443121CB8 for ; Mon, 13 Feb 2023 17:42:58 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 6B16E2C141 for ; Mon, 13 Feb 2023 17:42:58 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 5DEA063B1; Mon, 13 Feb 2023 17:42:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 5B9F16355 for ; Mon, 13 Feb 2023 17:42:58 +0000 (UTC) Date: Mon, 13 Feb 2023 17:42:58 +0000 (UTC) To: binutils@sourceware.org Subject: [PATCH] PR30120: fix x87 fucomp misassembled Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SCC_5_SHORT_WORD_LINES, SPF_HELO_NONE, SPF_PASS, 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: Michael Matz via Binutils From: Michael Matz Reply-To: Michael Matz 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?1757738632864401889?= X-GMAIL-MSGID: =?utf-8?q?1757738632864401889?= this fixes the entry for 'fucomp' to use the correct Reg value (otherwise it's assembled as 'fucom'). --- Approved by Jan in bugzilla. I've also added some comparison forms to a old testcase. gas/testsuite/gas/i386/float.l | 15 ++++++++++++--- gas/testsuite/gas/i386/float.s | 8 ++++++++ opcodes/i386-opc.tbl | 2 +- opcodes/i386-tbl.h | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gas/testsuite/gas/i386/float.l b/gas/testsuite/gas/i386/float.l index ec56f555d36..d7b3ca022da 100644 --- a/gas/testsuite/gas/i386/float.l +++ b/gas/testsuite/gas/i386/float.l @@ -80,6 +80,15 @@ 67 0080 DEFB [ ]*fdivrp %st\(3\) 68 0082 DEFB [ ]*fdivrp %st,%st\(3\) 69 [ ]* - 70 0084 00000000 [ ]*.p2align 4,0 - 70 00000000 - 70 00000000 + 70 0084 DDE9 [ ]*fucomp %st\(1\) + 71 0086 DDE2 [ ]*fucom %st\(2\) + 72 0088 DAE9 [ ]*fucompp + 73 008a DBF2 [ ]*fcomi %st\(2\) + 74 008c DFF3 [ ]*fcomip %st\(3\) + 75 008e DBEC [ ]*fucomi %st\(4\) + 76 0090 DFED [ ]*fucomip %st\(5\) + 77 [ ]* + 78 0092 00000000 [ ]*.p2align 4,0 + 78 00000000 + 78 00000000 + 78 0000 diff --git a/gas/testsuite/gas/i386/float.s b/gas/testsuite/gas/i386/float.s index 03d30b7ed74..1388e5b6893 100644 --- a/gas/testsuite/gas/i386/float.s +++ b/gas/testsuite/gas/i386/float.s @@ -67,4 +67,12 @@ fdivrp %st(3) fdivrp %st,%st(3) + fucomp %st(1) + fucom %st(2) + fucompp + fcomi %st(2) + fcomip %st(3) + fucomi %st(4) + fucomip %st(5) + .p2align 4,0 diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index 4b7b7891e51..2e39b712697 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -651,7 +651,7 @@ fcompp, 0xded9, FP, NoSuf, {} fucom, 0xdd/4, i387, Modrm|NoSuf, { FloatReg } // alias for fucom %st(1) fucom, 0xdde1, i387, NoSuf, {} -fucomp, 0xdd/4, i387, Modrm|NoSuf, { FloatReg } +fucomp, 0xdd/5, i387, Modrm|NoSuf, { FloatReg } // alias for fucomp %st(1) fucomp, 0xdde9, i387, NoSuf, {} fucompp, 0xdae9, i387, NoSuf, {} diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index 585a5bb875c..021f607872e 100644 --- a/opcodes/i386-tbl.h +++ b/opcodes/i386-tbl.h @@ -5290,7 +5290,7 @@ static const insn_template i386_optab[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } }, - { MN_fucomp, 0xdd, 1, SPACE_BASE, 4, + { MN_fucomp, 0xdd, 1, SPACE_BASE, 5, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,