From patchwork Fri Oct 14 09:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiang, Haochen" X-Patchwork-Id: 2601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp79301wrs; Fri, 14 Oct 2022 02:15:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6P9Cvue9j1R0vjtXUdwaD63Glkulo6rMNYwp+irlxUADNsDgDONTYzq9BYDwBlZXIkG+uF X-Received: by 2002:a17:906:794b:b0:787:a9ee:3bf0 with SMTP id l11-20020a170906794b00b00787a9ee3bf0mr2832218ejo.354.1665738906008; Fri, 14 Oct 2022 02:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665738906; cv=none; d=google.com; s=arc-20160816; b=aV7oKyydA7MnZt2LxNidLVGnXmixzpiTn76kqO2v/i/h5P0vCbItc49I8dXMK/A4yM glmAzUoTk8xR+q2qMV7u4L5G2+ycko1NeY7I3DI6ZX+YSnU3OqMr9JIPPsVECpLP9w2/ OugWM9VAEYgd7GkFo/n/sNxZz827SWJL9ylZzIe8xui6nHbNn7gT/DDqLQ/eJxWklWUK QF2otIh+OOQj+qvOlrz/pueA4vC7i6enCjTyq1SWRadJI19pF3zHr9oiy7hGYDFmqTuj mwsSwFDld2oLDYXF001eeVkUlZ1Q0rpYH9nug00qX7CVVGB3dKsJB2PZHt4K5kSRP3s5 cFAg== 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=bO5fUCUFRmeRObOarAUsbyLQHDNlMKNyJqtBLdlm+Ks=; b=h76OtaE6dZcP6HRD6S7doUscbRQhN+x32dUGYiVf/AgkbpH8lkU+1OecEdJArt9bW2 W4000o/xBE9+k20+E9N8AUf5aEePN90MFFg8hUkmf5tElhQswOuoMtuqHU4vy6TWTISU lv0wciL2fROThZKlY72mCeqScIWj/ix6fY5/kx3uwp/rDyFmt4i3pUemhhdUQDPhKJW0 gUP64aEaHUFguYZqbXgnrtSSN/3Gj0/QMhreCs2jV008poMo9tDiytJVYYDDqdC0Dzuf UgOVIihZbPmpbBvEaxHgFjVvcxyNAAChkq3T8grHSo/UHmzKKKCQ5n47JCfkrl8+ijUo g/OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hCxfxCfg; 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 di13-20020a170906730d00b0078e19e971b2si1917332ejc.915.2022.10.14.02.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 02:15:05 -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=hCxfxCfg; 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 3BE0C3858297 for ; Fri, 14 Oct 2022 09:15:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BE0C3858297 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665738904; bh=bO5fUCUFRmeRObOarAUsbyLQHDNlMKNyJqtBLdlm+Ks=; 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=hCxfxCfgmuAtvvNtPixNLcH4gL1OiovKOj2gYU6t9yvM+BvbmaBJN1nnsiWZ30i9d 0jiUDwFINr8PDFLCC8wV1Cmpt6td9G4NK7CtqrlyqlOvGkI7YhpfAmyNRBZ7YXVwT6 2iIQhR6CO9jdUV+W8oofcf8Ax5GlAzkaPEv5m9Zk= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by sourceware.org (Postfix) with ESMTPS id 5F3243858404 for ; Fri, 14 Oct 2022 09:14:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F3243858404 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="369520160" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="369520160" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Oct 2022 02:14:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="629873042" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="629873042" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga007.fm.intel.com with ESMTP; 14 Oct 2022 02:14:52 -0700 Received: from shliclel314.sh.intel.com (shliclel314.sh.intel.com [10.239.240.214]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 5500D1009C98; Fri, 14 Oct 2022 17:14:50 +0800 (CST) To: binutils@sourceware.org Subject: [PATCH 05/10] Add handler for more i386_cpu_flags Date: Fri, 14 Oct 2022 17:12:43 +0800 Message-Id: <20221014091248.4920-6-haochen.jiang@intel.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20221014091248.4920-1-haochen.jiang@intel.com> References: <20221014091248.4920-1-haochen.jiang@intel.com> X-Spam-Status: No, score=-11.8 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?1746653839007374094?= X-GMAIL-MSGID: =?utf-8?q?1746653839007374094?= 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 0d161d60ef..7045e18cff 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. */