From patchwork Wed Oct 19 15:15:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 5676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp384200wrs; Wed, 19 Oct 2022 08:20:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6gfOy+Xg2LfaSyCZ9MYO65kpffi3fYhWLCm3rg3LjfomPMSWCVyIEheamo8Lq3u2HiViHi X-Received: by 2002:aa7:d458:0:b0:45b:ddbf:39fa with SMTP id q24-20020aa7d458000000b0045bddbf39famr8134604edr.335.1666192809918; Wed, 19 Oct 2022 08:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192809; cv=none; d=google.com; s=arc-20160816; b=ZVwHTH+zxonnO2PUogHhZ9vZ8OirsQZSRk+eA8imsKKpFZ1995mvBvT2KVAmjDCPpX NnXd3rZtt0IAYiCbM/G/1DElIGl2b9T4Qtlv1CUQHGL+8hOlu/Ji9UcGPyU3RLkviAs/ gzeqTTFDqEYWnrgH26NzjbFLQ1GW9ZpUAYLmMyCMPCVUS7pcdi69vp5nB/RGqurt2uKa 2NwyiYm7NlxfIGDz0z+c63H4X8hym6tN0uN2GkwyzUWBAmCP3VUa4rCVHoycZUuQPJlz vHLmkfirS1lfvGGNnN3dQ23pYb5D3K80blqUIddiDMCn3XuCvK9qCtAqAkyYLClyyJ88 X3jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=WoRaB68vf7uyWQhFOAzwdOA2WSE/0c4dWZnmomgjmPc=; b=bKAinsbSq7hPGFOyMqjpsOANgedoteHYtZLi7ys987Ameh45bp92l7/vBRsazxp7RE UQKffuxsEc/VPZYD69SpZWzAhehD+EUvW0xSrFHr8FqYAKrg0rTNc6cZpYRZjFVKvbl1 P5CEK1Hj2KmcREihlqWRzn+TAKLpyWnq4VKZPQ/VzqH73Xh0ngMvB12Z50JOeFKovhOO bWKaqp+antrYmyj84CI4u7bEVFh1lhMmASZVjUGYIl0W8n9wngbNES4MJTGw/Cop4OZ1 ArwRBgKoRvvg1BtW0p7ZHjO8IMKA79MrAQizzuFYQcdSBmcctc0Rg3Di8m3PsqOSRdVj EzFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=EiMplKvk; 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=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k19-20020aa7c053000000b004573f60f27csi13181395edo.440.2022.10.19.08.20.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 08:20:09 -0700 (PDT) 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=@sourceware.org header.s=default header.b=EiMplKvk; 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=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F14FA3851C0B for ; Wed, 19 Oct 2022 15:18:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F14FA3851C0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666192739; bh=WoRaB68vf7uyWQhFOAzwdOA2WSE/0c4dWZnmomgjmPc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EiMplKvkC2py5eQ3MeiDfmLjOGFkC85YuPn1As6MmO6wbKiTxG5iAiDgiqjUf8TWv kg+4sl9UjjlEIKPISbgHV+p05pNRjW2Kv++EVhwG41j/BlQEdCRknjXApNIuWlizcI BB+cFJeVeDmT5zUjIJwO/dc9AH/zTrJPPFmGcPA4= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id B0C7C3858C83 for ; Wed, 19 Oct 2022 15:17:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0C7C3858C83 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="304056009" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="304056009" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 08:17:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="692434854" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="692434854" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga008.fm.intel.com with ESMTP; 19 Oct 2022 08:17:39 -0700 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id B663F1007806; Wed, 19 Oct 2022 23:17:36 +0800 (CST) To: binutils@sourceware.org Subject: [PATCH 05/10] Add handler for more i386_cpu_flags Date: Wed, 19 Oct 2022 23:15:29 +0800 Message-Id: <20221019151534.45521-6-haochen.jiang@intel.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221019151534.45521-1-haochen.jiang@intel.com> References: <20221019151534.45521-1-haochen.jiang@intel.com> X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Haochen Jiang via Binutils From: "Jiang, Haochen" Reply-To: Haochen Jiang Cc: Kong Lingling 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?1747129791498383042?= X-GMAIL-MSGID: =?utf-8?q?1747129791498383042?= From: Kong Lingling gas/ChangeLog: * config/tc-i386.c (cpu_flags_all_zero): Add new ARRAY_SIZE handle. (cpu_flags_equal): Ditto. (cpu_flags_and): Ditto. (cpu_flags_or): Ditto. (cpu_flags_and_not): Ditto. --- gas/config/tc-i386.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index f887074e60..81bbf22fec 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1618,6 +1618,10 @@ cpu_flags_all_zero (const union i386_cpu_flags *x) { switch (ARRAY_SIZE(x->array)) { + case 5: + if (x->array[4]) + return 0; + /* Fall through. */ case 4: if (x->array[3]) return 0; @@ -1643,6 +1647,10 @@ cpu_flags_equal (const union i386_cpu_flags *x, { switch (ARRAY_SIZE(x->array)) { + case 5: + if (x->array[4] != y->array[4]) + return 0; + /* Fall through. */ case 4: if (x->array[3] != y->array[3]) return 0; @@ -1675,6 +1683,9 @@ cpu_flags_and (i386_cpu_flags x, i386_cpu_flags y) { switch (ARRAY_SIZE (x.array)) { + case 5: + x.array [4] &= y.array [4]; + /* Fall through. */ case 4: x.array [3] &= y.array [3]; /* Fall through. */ @@ -1698,6 +1709,9 @@ cpu_flags_or (i386_cpu_flags x, i386_cpu_flags y) { switch (ARRAY_SIZE (x.array)) { + case 5: + x.array [4] |= y.array [4]; + /* Fall through. */ case 4: x.array [3] |= y.array [3]; /* Fall through. */ @@ -1721,6 +1735,9 @@ cpu_flags_and_not (i386_cpu_flags x, i386_cpu_flags y) { switch (ARRAY_SIZE (x.array)) { + case 5: + x.array [4] &= ~y.array [4]; + /* Fall through. */ case 4: x.array [3] &= ~y.array [3]; /* Fall through. */