From nobody Tue Feb 10 08:31:22 2026 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=1668765042; cv=none; d=zohomail.com; s=zohoarc; b=C1GVJowHLYcDQpeN2DHDuXannFgAcFkM14doF+JyvPtiaPGtkxTty5coIWeJnMpPhyfUzWd4ZSQ17P0Sohio9Rt/5A+6/hScy1xut7WNjGy71qJb0ey9qBCzXC5TE7oYWnZRPFc5ZtDR+ULAp4DBnxJqkaEiqPCoCH3TPpo9lMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668765042; h=Content-Transfer-Encoding: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=v1qkRSPQlg7fc/AQ74qQ3P9alwy8MipeuIKQlrtf4KE=; b=b8/QVodaw4p6KsPkk2yNGUsvIR5EQ6NS+DCYHSafelfmcneJFZ7N3mouKSwPVHEHwcQ/MjIfHtU8p3iHkTp1VX6utr5cYO+yAZan6Ql9slXHFuPSa3OuPWjNBPryDhq8Q5N3s9GBOlv2JBZaLep0zTzCje8ubx18CkMuRPi65CU= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1668765042471380.5948976756348; Fri, 18 Nov 2022 01:50:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovxzh-0007rg-5J; Fri, 18 Nov 2022 04:49:09 -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 1ovxz8-0007Sz-M5 for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:48:38 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovxz6-00025o-Dj for qemu-devel@nongnu.org; Fri, 18 Nov 2022 04:48:34 -0500 Received: by mail-pl1-x632.google.com with SMTP id p12so4110869plq.4 for ; Fri, 18 Nov 2022 01:48:31 -0800 (PST) Received: from stoup.. ([2602:47:d48a:1201:90b2:345f:bf0a:c412]) by smtp.gmail.com with ESMTPSA id n12-20020a170902e54c00b0018862bb3976sm3115421plf.308.2022.11.18.01.48.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Nov 2022 01:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=v1qkRSPQlg7fc/AQ74qQ3P9alwy8MipeuIKQlrtf4KE=; b=YojAn+9Aqybx3TDaEWV3UVTSV7lS5Ixo4H6t4IGR8zdRhp0YJIP4AHKsQodjdh1W1k K6KDKswmdZHIu4N8BfUJP4zuOPXaeXSLp1KZdgK4pgCfZVOLFz7Pd4Tqc5K8lKoEaec+ 87e6mt2F1xYZJMeIaveMK0rDiCrfCKSA+lvWgD+/xDj52R9P3qQdVPmdpEv00xgq8C8b 1+xg7q4QuLO2u+nVAwuWzuAOpc/EJ3LdhvtowfSJLH1XLsuPPzWqzDjZJB+dzrIlwpkX fXi0uOvPsjLzcwirDlreY4CxTokDEMop6jEeK6pgDByial6tZx1o+UVyESCA9d2SPGne xVtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=v1qkRSPQlg7fc/AQ74qQ3P9alwy8MipeuIKQlrtf4KE=; b=lcKeZrJ9Fa3Fptjy3fj0VnMOkKw9fDFVTmhkYnicaUvGOYPgo2W/C4/gsqpAzrM79d mZPP1QbNfPbJCN/+WquIL1tTo71hpjraOWTy7FOaakOvdxvuYOTkNLo9ZrgI3KP2lR20 K046dneiU9mpQEpKyceudiMFyD2LHykq9PspfN5A1YDzkdedNn4AkV4Zl6jIxuSsaMEN QMul9NS/XsCS5swJqVAwyzJxbl/eUgIcNUnYf7cChFUMuWfYE5sG53UYPRrP3C5sBN5Q n36bt+QqDkcK19eEHbQjJeKkUu+LgfIZzsaSH/cSwvmJBp5T9+M6wYqA28PErt9LeyNY BEuQ== X-Gm-Message-State: ANoB5pnQR0dIPxhkdiQqwfYqi5iMBxTuoOlPMV48O4n0vktLosTaOTSh 3vkqONtXJZw42pRnPjzIX8KWx90UAJOyJw== X-Google-Smtp-Source: AA0mqf7WTSC/sDpO+ZPfEdxz7qpwNwRP+jVs3/Gp1l4vWGN+1JDh4i05D8bMbmXgQCaa5JlNbbA7KQ== X-Received: by 2002:a17:902:ec8f:b0:186:9f20:e7e2 with SMTP id x15-20020a170902ec8f00b001869f20e7e2mr6453348plg.174.1668764910629; Fri, 18 Nov 2022 01:48:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-8.0 17/29] tcg/aarch64: Add have_lse, have_lse2 Date: Fri, 18 Nov 2022 01:47:42 -0800 Message-Id: <20221118094754.242910-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221118094754.242910-1-richard.henderson@linaro.org> References: <20221118094754.242910-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::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1668765043888100003 Content-Type: text/plain; charset="utf-8" Notice when the host has additional atomic instructions. The new variables will also be used in generated code. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 3 +++ tcg/aarch64/tcg-target.c.inc | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 0dff5807f6..b8f734f371 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -57,6 +57,9 @@ typedef enum { #define TCG_TARGET_CALL_ARG_I128 TCG_CALL_ARG_NORMAL #define TCG_TARGET_CALL_RET_I128 TCG_CALL_RET_NORMAL =20 +extern bool have_lse; +extern bool have_lse2; + /* optional instructions */ #define TCG_TARGET_HAS_div_i32 1 #define TCG_TARGET_HAS_rem_i32 1 diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 001a71bbc0..cf5ee6f742 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -13,6 +13,8 @@ #include "../tcg-ldst.c.inc" #include "../tcg-pool.c.inc" #include "qemu/bitops.h" +#include + =20 /* We're going to re-use TCGType in setting of the SF bit, which controls the size of the operation performed. If we know the values match, it @@ -71,6 +73,9 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind = kind, int slot) return TCG_REG_X0 + slot; } =20 +bool have_lse; +bool have_lse2; + #define TCG_REG_TMP TCG_REG_X30 #define TCG_VEC_TMP TCG_REG_V31 =20 @@ -2918,6 +2923,11 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOp= code op) =20 static void tcg_target_init(TCGContext *s) { + unsigned long hwcap =3D qemu_getauxval(AT_HWCAP); + + have_lse =3D hwcap & HWCAP_ATOMICS; + have_lse2 =3D hwcap & HWCAP_USCAT; + tcg_target_available_regs[TCG_TYPE_I32] =3D 0xffffffffu; tcg_target_available_regs[TCG_TYPE_I64] =3D 0xffffffffu; tcg_target_available_regs[TCG_TYPE_V64] =3D 0xffffffff00000000ull; --=20 2.34.1