From patchwork Thu Jan 2 18:05:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 854689 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7902739wrq; Thu, 2 Jan 2025 10:11:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5npX4t9p/BWUntAX2um2OlAi23t+VCn8ynf4o3hGTRsszNwUNagmMo/m8K8N/aRfu8oRydg==@linaro.org X-Google-Smtp-Source: AGHT+IGxvsKzWzt5X2kuu/07HYqGhEznHXf8BvPlXPFokAHHn6BSovkKdK/dGkuXzi+E6m3Z1eIn X-Received: by 2002:a05:6102:b04:b0:4af:be6e:f0aa with SMTP id ada2fe7eead31-4b2cc49d580mr26908448137.25.1735841474214; Thu, 02 Jan 2025 10:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735841474; cv=none; d=google.com; s=arc-20240605; b=j1RGuWDioFeFCEqIo/4pRHoJDQ/fWOm9sw0qXFn2GiyMGXtTs+BazBaSJiF3e0ga8u LKMq349f2+xNj/+4RgtWxPruWB7HuiyG2kKyteDYLs4B4GoKeieVW2qIPnuwz3fNBvoH XLxsN348jduo3FNqXlvtD5gEsKEyb1spbVXj4RiE+ziyH2dO8sXGrUh8/BjPP6HEJtBM cALC5Pxt1S9snNSjstKxYv7R90Ol+rQ4LPGBCApckDlg+zB8or9bdWTwsfd7PYBLXtVS 7Mb3DU2+iVn2gL8hu6LCTE1D6OxVN5+dWp2FaTy9uSeaFoCSst/MXCwLSbWRwCr9+lU+ dyhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hrD0/5NzV+BvoUzp4RbMZrucNLSTx7Ozt+v7L0p+ucA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ZveeV5UDNrVt2zNwxmWx3MIXSpAk89GaUjrHPFQNm0EvQQSIkwjPvYiYIDu4Dk5A9Q lJ1drWgNThbBnYyidUSiL8vFO6g2zzzNDltRRKwR+WXYVKfH6tiOFq6VHe3BW9AdOi7s 42ut++QeD4gPF+Z5H9DugvXh6Ws9mIGobzgNKKZonScjYoZlZxbv8vRatIW5lXVqviZz ip45scWEuKk6n9aaMqLkJgJpxLd1ZkviOjSzgRHRko81RWo40uYO8baEPNTrMpvR6ql9 bmJl+wGYSBaUb//vG017wizbgU50KriFrEILcDcd39/4fpDD1jAOETKUp3ct6mdsEfDe I0/w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JUQu4WwJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-8610ac12b4dsi8467778241.10.2025.01.02.10.11.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 10:11:14 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JUQu4WwJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTPbh-0007A1-Rw; Thu, 02 Jan 2025 13:07:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTPbD-0006xw-T2 for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:07:12 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTPb7-00057n-Q0 for qemu-devel@nongnu.org; Thu, 02 Jan 2025 13:07:09 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-21661be2c2dso144676155ad.1 for ; Thu, 02 Jan 2025 10:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735841223; x=1736446023; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=hrD0/5NzV+BvoUzp4RbMZrucNLSTx7Ozt+v7L0p+ucA=; b=JUQu4WwJzEv+x/ttNMRA6LI55UuY2AKlRtzjBDLV/CO1OFiAovuZzeiMIonnLdmL5A +mZnngOvr3gIEsgPyxf3Qov0PUFikW72WjNGyuQ2seg1XhoZdnluSfepHPV+9nd7qa7H y8ppNlM0vhGtWrLNvAr9h3iPOSpOd9fX+Re601YajF7CkRjQdfs6uzhbxi0IQ8MmVzuq CrClk9r699XFvZV82gdWPbHRM1HbDw+4mPTcoXjqOZDYMEO+PQZ/DzCDc7ttbj9wF0SC grO3OZRthI1izI9wb9a0EDoofLx2ve58EK37y+0DwkHwT2s1EocRWKBkxQu5ZeWfACtX A8pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735841223; x=1736446023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hrD0/5NzV+BvoUzp4RbMZrucNLSTx7Ozt+v7L0p+ucA=; b=BEnzQJGKaSXB8K96Da6JS/t3+30ldBV4hiBubvTn/0a2RZFTCfSSVuUoqaLSlYS4BR 02jiFGhDLwyXKbjoURFxhqbkRUjIb/Pg/45XBDRtPQ34gVKSXwso+lgxB8OzMKavhlTY 3YA3Gcp3NjOPxiZ/ecrJESeUCL7BX07WShKpnmrIACSQ1Gls2sTeGhYGXobvhe1GcRXa xkhsB0lomVa0Hab32wrwvK7ZKBM9GCVV92I6Na6VBEaanTvAcUT2F1XwJehSzcuyi50s AYkSX1Gk4YGGd+BIjKNmSGtuIHtTIrjhOH8y/HTiNXpMzEdP3ABqxLzCZyeLJkr/sak1 S54A== X-Gm-Message-State: AOJu0YxqUvCoBbqwsX7hZhmYbAsco7z/oLXqgnq+X27DQIwchd6/88MA pLO+XILoCzkpjCUo4uDi9HSK2QI1x0oqSUH6+KbwxSWwfLKA23Jthf8zM6bi9/8nsUqucxzDCzo I X-Gm-Gg: ASbGnctOy2EYjfPKvwUHWAI1J/5A9nImO9xwUmyiPxCD3icRs07Re/dY/4sgZ9OGXnn BiiTvffMa624urWt4PHn9wKlZwgWSXspa2LALW1SgT5GLZzYHYeNNn5x+eX1PStFXjVb4YEX17r u3qudZ8jzN7AWbzYHyjd/PTie86JDYuoygzOofrnEDLFeJpgoU1ri+cjQ+w2mSDDaLkKbTbL/WO uziu24MXldSNwGKAq78emvqz2yVkHF1nEc3nIYL4h5HBuP8VfnB14cEoqakeQ== X-Received: by 2002:a05:6a20:9c9a:b0:1e1:b062:f403 with SMTP id adf61e73a8af0-1e5e07ffc53mr73826562637.34.1735841222879; Thu, 02 Jan 2025 10:07:02 -0800 (PST) Received: from stoup.. ([63.239.63.212]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72ad3393d5fsm20604456b3a.154.2025.01.02.10.07.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 10:07:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/73] target/arm: Use tcg_op_supported Date: Thu, 2 Jan 2025 10:05:49 -0800 Message-ID: <20250102180654.1420056-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250102180654.1420056-1-richard.henderson@linaro.org> References: <20250102180654.1420056-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Do not reference TCG_TARGET_HAS_* directly. Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 10 ++++++---- target/arm/tcg/translate-sve.c | 2 +- target/arm/tcg/translate.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 7c65fc3a3b..86da0c702f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8219,6 +8219,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) TCGv_i64 tcg_rn, tcg_y; DisasCompare c; unsigned nzcv; + bool has_andc; /* Set T0 = !COND. */ arm_test_cc(&c, a->cond); @@ -8249,17 +8250,18 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) tcg_gen_subi_i32(tcg_t2, tcg_t0, 1); nzcv = a->nzcv; + has_andc = tcg_op_supported(INDEX_op_andc_i32, TCG_TYPE_I32); if (nzcv & 8) { /* N */ tcg_gen_or_i32(cpu_NF, cpu_NF, tcg_t1); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_NF, cpu_NF, tcg_t1); } else { tcg_gen_and_i32(cpu_NF, cpu_NF, tcg_t2); } } if (nzcv & 4) { /* Z */ - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_ZF, cpu_ZF, tcg_t1); } else { tcg_gen_and_i32(cpu_ZF, cpu_ZF, tcg_t2); @@ -8270,7 +8272,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) if (nzcv & 2) { /* C */ tcg_gen_or_i32(cpu_CF, cpu_CF, tcg_t0); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_CF, cpu_CF, tcg_t1); } else { tcg_gen_and_i32(cpu_CF, cpu_CF, tcg_t2); @@ -8279,7 +8281,7 @@ static bool trans_CCMP(DisasContext *s, arg_CCMP *a) if (nzcv & 1) { /* V */ tcg_gen_or_i32(cpu_VF, cpu_VF, tcg_t1); } else { - if (TCG_TARGET_HAS_andc_i32) { + if (has_andc) { tcg_gen_andc_i32(cpu_VF, cpu_VF, tcg_t1); } else { tcg_gen_and_i32(cpu_VF, cpu_VF, tcg_t2); diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 732453db6f..1a28d04f17 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/translate-sve.c @@ -622,7 +622,7 @@ static void gen_bsl2n_i64(TCGv_i64 d, TCGv_i64 n, TCGv_i64 m, TCGv_i64 k) * = | ~(m | k) */ tcg_gen_and_i64(n, n, k); - if (TCG_TARGET_HAS_orc_i64) { + if (tcg_op_supported(INDEX_op_orc_i64, TCG_TYPE_I64)) { tcg_gen_or_i64(m, m, k); tcg_gen_orc_i64(d, n, m); } else { diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index c16b59ab88..1b5bddcad1 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -493,7 +493,7 @@ static void gen_add_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1) static void gen_adc_CC(TCGv_i32 dest, TCGv_i32 t0, TCGv_i32 t1) { TCGv_i32 tmp = tcg_temp_new_i32(); - if (TCG_TARGET_HAS_add2_i32) { + if (tcg_op_supported(INDEX_op_add2_i32, TCG_TYPE_I32)) { tcg_gen_movi_i32(tmp, 0); tcg_gen_add2_i32(cpu_NF, cpu_CF, t0, tmp, cpu_CF, tmp); tcg_gen_add2_i32(cpu_NF, cpu_CF, cpu_NF, cpu_CF, t1, tmp);