From nobody Wed Apr 9 10:31:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1612318733; cv=none; d=zohomail.com; s=zohoarc; b=OSgkFdvL7CCF5eJazzaTZHT8c1RIKaVitHNdwBDmqtwl/qFCHkFYpWjCHg3x/kVfZONc2ep4cRiMBrN1SB+RIakEiuDgqL6ZscWxP+QWvU8trG55uhm2c7TvIl0MpBi7n2Qb3FjeuA9eMfGmbeKidcHCbV2hlLhuskNu8ATyE1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612318733; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QGZAwO5rTh2JAQ9XLxRx7IOhFM9ofCWQVhsgDPWW8kg=; b=luMSTyBWt6alT11lXrEKp5AXjXrZisQKOQShO0Oafh4upSZ4xS+IMyJmS19FUye27sDT37xYP1TErdcUrvzD9tX62l32aOzXZNZb/8i2U6qVqfDTH1uQH/vXJWyMy5hWUXAoiKbeWkgAf5aKG8lfQLpIKSf6ob+WhEWLN0cBoM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161231873330937.65957152248393; Tue, 2 Feb 2021 18:18:53 -0800 (PST) Received: from localhost ([::1]:56080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l77kq-0000wX-13 for importer@patchew.org; Tue, 02 Feb 2021 21:18:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l77i5-0007ZV-En for qemu-devel@nongnu.org; Tue, 02 Feb 2021 21:16:01 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:39848) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l77i3-0000yE-TM for qemu-devel@nongnu.org; Tue, 02 Feb 2021 21:16:01 -0500 Received: by mail-pj1-x1034.google.com with SMTP id d2so3638482pjs.4 for ; Tue, 02 Feb 2021 18:15:59 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id x1sm270301pgj.37.2021.02.02.18.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 18:15:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QGZAwO5rTh2JAQ9XLxRx7IOhFM9ofCWQVhsgDPWW8kg=; b=feXAvVWo189mN2kbWAVCG3QWyJE1VkciZEMFzVlNuXlIit8mYnlS4EyNz8SN4if3YR Ag0dfp0FYZfwTNVFjzmcHPjz9WH0vqZNQdn+JzQNMZ4SI8bbPHxSL5ampUBE5Vv/bY9l tB0i4xBwWW/FhAqH9NmKJVDmuAgJoVxEkIPegtNHjjJeP27ug6HftrF2W0fnuyu2G65q JfN9PYNRvKbnhu7lZA7s6P1LuqncwJCJf7QLLNlC+T6NVdNugyCIhVjZQ5NNi4ksYh5n VXnSAda5X2lObF1qSfG5dvOap5C1/Nf9FHGhtgy2v8GrLzPiWPfhyd11Uxuj9xktNdBW 3aew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QGZAwO5rTh2JAQ9XLxRx7IOhFM9ofCWQVhsgDPWW8kg=; b=T02HVsBWBMvEo8rgSn1Pm0nCifr0Xe3ZxEGEguRlD6CEr1pjaoDlv48sJW6m4Se8FC nndSC8Bm87GtjnHG4IafBeaDK55k9Z9UXpzBwJhqLtKfDy4mzSlmyCbJMaKlgdqF1cUc FvzGV7qFRoCbHdBcsiF/12x5+05HYdZiiY5VwgqZ6BP/CdN+8bMwtohiznfpyo7E3fAO f2lHdfgjypVJ3unAwvOXGyt+FRFriSHsrb7ZGlfKoMB1FlNj6YrD55wNJFY1BCfjT5Y7 yO4Uum2aiE9xEYjdw8gNcR1BOdogNP+3cnQ55fLTR/6rQ/DDMwRGJaepH+82sgZepL47 y2Vg== X-Gm-Message-State: AOAM530K2zaOv76rUwTriQNAn93mNTGty3nOtpr6AJfYYwuItlgSj6J3 Eq5eYwRL+s7P5iDS+CKCtJVQlHzxFVuy3wBY X-Google-Smtp-Source: ABdhPJy/0+izfBzAZPIJJ/17e/ESiKFTxp/AzhVLXXMsHrK6DApKIAm6WGz3XtEeMOksM+NIFMyztw== X-Received: by 2002:a17:90a:648f:: with SMTP id h15mr840735pjj.142.1612318558664; Tue, 02 Feb 2021 18:15:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/24] tcg/i386: Move constraint type check to tcg_target_const_match Date: Tue, 2 Feb 2021 16:15:29 -1000 Message-Id: <20210203021550.375058-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210203021550.375058-1-richard.henderson@linaro.org> References: <20210203021550.375058-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Rather than check the type when filling in the constraint, check it when matching the constant. This removes the only use of the type argument to target_parse_constraint. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 050f3cb0b1..540debdf34 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -263,13 +263,13 @@ static const char *target_parse_constraint(TCGArgCons= traint *ct, break; =20 case 'e': - ct->ct |=3D (type =3D=3D TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONS= T_S32); + ct->ct |=3D TCG_CT_CONST_S32; break; case 'Z': - ct->ct |=3D (type =3D=3D TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONS= T_U32); + ct->ct |=3D TCG_CT_CONST_U32; break; case 'I': - ct->ct |=3D (type =3D=3D TCG_TYPE_I32 ? TCG_CT_CONST : TCG_CT_CONS= T_I32); + ct->ct |=3D TCG_CT_CONST_I32; break; =20 default: @@ -286,14 +286,20 @@ static inline int tcg_target_const_match(tcg_target_l= ong val, TCGType type, if (ct & TCG_CT_CONST) { return 1; } - if ((ct & TCG_CT_CONST_S32) && val =3D=3D (int32_t)val) { - return 1; - } - if ((ct & TCG_CT_CONST_U32) && val =3D=3D (uint32_t)val) { - return 1; - } - if ((ct & TCG_CT_CONST_I32) && ~val =3D=3D (int32_t)~val) { - return 1; + if (type =3D=3D TCG_TYPE_I32) { + if (ct & (TCG_CT_CONST_S32 | TCG_CT_CONST_U32 | TCG_CT_CONST_I32))= { + return 1; + } + } else { + if ((ct & TCG_CT_CONST_S32) && val =3D=3D (int32_t)val) { + return 1; + } + if ((ct & TCG_CT_CONST_U32) && val =3D=3D (uint32_t)val) { + return 1; + } + if ((ct & TCG_CT_CONST_I32) && ~val =3D=3D (int32_t)~val) { + return 1; + } } if ((ct & TCG_CT_CONST_WSZ) && val =3D=3D (type =3D=3D TCG_TYPE_I32 ? = 32 : 64)) { return 1; --=20 2.25.1