From patchwork Wed Oct 19 14:56:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 5614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp371237wrs; Wed, 19 Oct 2022 07:56:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5B5d2d7vJu/i4/ysipaJqL2/TreEYfNheSq7LLViLO6l3CsYXsn/cYIZpncrLBiJ9KWl75 X-Received: by 2002:a17:907:7f07:b0:779:7f94:d259 with SMTP id qf7-20020a1709077f0700b007797f94d259mr7017283ejc.525.1666191387267; Wed, 19 Oct 2022 07:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666191387; cv=none; d=google.com; s=arc-20160816; b=Me68pk+fbhhmDHFmcAdYwL0Bs+Kn56S7YFdwV2RxWl39/92mU98Pr4hRokuOylwyaE V3qJn2Udz/3kF6sCYxk/piZ9AqqKVEz8yJ3i4/lYWEr4RtwNjYUDlj5jsaMoG/R5us0n FuZwedzu9J2ZyZK/hi7MQ03h0/OW13zHg4LF3aYS6Xy7D0HnA6EO9ELcDZMxLyGjtGM4 WKQDRBrw00vuXzBE1SBhRLGggLJcgLVr5n7Rqv8v4GEAm7vkHnCGRWQn0nmjmV2PBLMi eo1stMl13PPMExMlYrVKQKMKu91io0CFnDcd9OTKDkj0rOEqzcy+n0HYg0q3xhh+FCgJ hoVA== 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=OdFVCMyS0E+fD2GCsBxViAvpInLcbfFUOatrHHnYS1kyPnlSN87YzTEd3BFAnRsxkP 1A3supaWcdK7OPGvCdx13JsvsJ6q2KPUx+M8GQpcSR/OSnfxCDWew1+FncEDw++5NU8U HARMHYIeiRyLS4XnqkQ/EZP8hKpm6+7g4UNAGDrPbnn2yZaCRvFGj20SINEAPe16Qy8e Q9Sc3acSpP2ZRMMoMc9u1fb/uuv/oEgiayGDObkARHmnrMdC7eg0p8aGYJzwDTVTEYnD y9+vBsRvfUMzw/+cWYNky5lE4c86eUMSuNIDDkCbQDYJqP1F6LkhS7qbr81nyfd3hrEE WjQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="ymB/W3Dm"; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id i7-20020a1709064fc700b0078d6418dcb8si16858262ejw.456.2022.10.19.07.56.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 07:56:27 -0700 (PDT) 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="ymB/W3Dm"; 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 162F03858415 for ; Wed, 19 Oct 2022 14:56:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 162F03858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666191386; 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=ymB/W3DmFpLD7z91MdRuJn7xf1KWai5EfHgvLESNsMtW+YzJqXKlOeOGUFaBs4IBW x2XKGBvmCGW2UhjTAtndEzBqruM78xsjZ6uR0ysC0OapoT4/mTOZXq6kHKI6SVqsgD JXpQsDQYcyXqq6NlrOiusLWpQY81U2AO35T6WXm0= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 8ADA23858C83 for ; Wed, 19 Oct 2022 14:56:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8ADA23858C83 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="289749462" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="289749462" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 07:56:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="804336399" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="804336399" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga005.jf.intel.com with ESMTP; 19 Oct 2022 07:56:14 -0700 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 164A61007803; Wed, 19 Oct 2022 22:56:13 +0800 (CST) To: binutils@sourceware.org Subject: [PATCH 05/10] Add handler for more i386_cpu_flags Date: Wed, 19 Oct 2022 22:56:03 +0800 Message-Id: <20221019145608.45213-6-haochen.jiang@intel.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221019145608.45213-1-haochen.jiang@intel.com> References: <20221019145608.45213-1-haochen.jiang@intel.com> X-Spam-Status: No, score=-11.7 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?1747128300264154717?= X-GMAIL-MSGID: =?utf-8?q?1747128300264154717?= 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. */