From patchwork Thu Oct 26 00:14:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738275 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp559169wrq; Wed, 25 Oct 2023 17:38:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWK9PH0VG/6olZhEd7JIoKbIbcaF8eYAGvQZC28LQVJEk6GjTop7LYrA1QNZzmDCMJylYD X-Received: by 2002:a05:6402:274e:b0:53e:3839:fc81 with SMTP id z14-20020a056402274e00b0053e3839fc81mr13625404edd.32.1698280706610; Wed, 25 Oct 2023 17:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280706; cv=none; d=google.com; s=arc-20160816; b=tsNN6qoVb7NHsN3nJm1PxjAhdKj5CxuPH9ezqHyFTQqStxUFNe5lotaLqxEUwSxI8u KsJznzzHcPd8nLXKNU5vtyFVTH21FkwbboOo3xS6NQ4nLynRVlynLHVIpOHrLdxqoksY pduZ0ULzoiQw5OXbJb5RnoTVkTCCjWoz64iDo5S97NWGYUV2nZdDWuWhPmdmVds14B6m hhu/vNRnm6Dq14MrZTbrKle1NX1AfQ2gvgXzbSsZVxwnqpEZgccu0o1hWQ1zIYLL5VJx Ox7FtNIJ0H37An9Jzr0laLz/VZxUntBRzApTX55BTG8AfjhMp+f5iIGPYnmQQWDBZQqu YH5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:cc:to :from:dkim-signature; bh=zhJv02LeNSNRi9K7QfhBZ5XwbuSGXoIYziudXEjPl7w=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=a6YlXnveRoDW63dH/bNbjQ0Q4qEFwaW49sijgjh5sWdgWX0ibp8mKX9BaZO8wduLt9 bXU96P8U1uxkIncu2bmD5L6qjgpdfk5X5qIzKkw4TbDPIlWGhOksWAdmx36HAu+Cl2R+ WjU+kl4ajMbvaR12wxRd/FUKiwaD7Pnp3PST6m1MzfkgAJsV+kxb9wA6Q6r4ZbTsYNuo W8m0O/X+wA0DYtupcYx85ZIOBAo/62o8cOJBFNstE5I5G5ysPLJLwAWQyNxDXmSGIEPl Gn8+p4JALEPS1qm+/znXGXbwGQ9yvhNOcfN58M74+wzsiTRU6LdlBpzpihZghRtmaZ/l 39iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dexLZLnG; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x1-20020a05640226c100b0053e8d9cde18si655327edd.118.2023.10.25.17.38.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:38:26 -0700 (PDT) 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=dexLZLnG; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo2t-00079n-0P; Wed, 25 Oct 2023 20:16:19 -0400 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 1qvo2l-00070s-Fe for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:12 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2h-0004rS-M5 for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:11 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cbf47fa563so2273905ad.2 for ; Wed, 25 Oct 2023 17:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279361; x=1698884161; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zhJv02LeNSNRi9K7QfhBZ5XwbuSGXoIYziudXEjPl7w=; b=dexLZLnG8XlB4nwE91iyK5LfQE+ksa6jswIdG2J/GHtuzYXQjur9Qwk+wKi6fkl+jd ltD0zqjwfHDFvmU4ZhihH2AOZCq8GLKJdAPDuOXmSu0jpZ7UJ0c/oYFYt2gWGpvOkipG kOzj/EjZJQXHSFx0XC/ggTDzKhDPPe5/IWioGd+s9CP8Xv+MoAMDnif/IEjAWV1pGwn1 KkHjkftQzU4BDR84P7zG4ow74hOJ0WXXCTFeIVlWu8+90zhPhGZoUHy9d7zKI8TiIpAQ fv87pLf7bb3X/VYzaSsnm7Xty1KAeFRBGUSnYQO3tVvuJv/3tht/vG9kISml6gzqOZA9 f+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279361; x=1698884161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zhJv02LeNSNRi9K7QfhBZ5XwbuSGXoIYziudXEjPl7w=; b=XwybAS7lKVjHE0D6NiG5Tk2KIeeKOGxWeiwqcq1cMY7SteWQaNwPaRUVXlvNzsG9jO DT0vsuui8HtgrYVHSaaZ57Y2o9tllsWo0Sl/OCV/PPg4J0JTWvQJp0qH2lhqofDyRrSH 6pzXsvrVnW8cfIRcAEC9u5c1ED9ORc3DJBX4cYT8u5JziuA7BYNfN8h1C1le/4odd5UM xVrQLNiXBGKzbUnFmlswFQVFXzOIkARXBNhfMytE0WIb9ECPaMVXGSa4M4lbUHurX+HS mU+d0Hu4H8SpOAgmqjk8+oIUs4lKDHHTvpFR262YC0Vcxhj0ICISWSpPtTKliy99rSDd 6UXg== X-Gm-Message-State: AOJu0YwFL4Q+XSaVMh5V3k+NyHeTTdwYeA6z8NnGk8JwFiH4s8UrHwQI dYH4MEvHsIx0YQkY2gqhG4EJrX68J4t7pLt298k= X-Received: by 2002:a17:902:db0c:b0:1ca:7909:6ee6 with SMTP id m12-20020a170902db0c00b001ca79096ee6mr14908654plx.61.1698279361374; Wed, 25 Oct 2023 17:16:01 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 11/94] target/sparc: Define AM_CHECK for sparc32 Date: Wed, 25 Oct 2023 17:14:00 -0700 Message-Id: <20231026001542.1141412-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 Define as false, which allows some ifdef removal. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/translate.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 080bc5f8a2..9eb2b7e52f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -268,20 +268,21 @@ static void gen_move_Q(DisasContext *dc, unsigned int rd, unsigned int rs) #endif #endif -#ifdef TARGET_SPARC64 -#ifndef TARGET_ABI32 -#define AM_CHECK(dc) ((dc)->address_mask_32bit) +#if !defined(TARGET_SPARC64) +# define AM_CHECK(dc) false +#elif defined(TARGET_ABI32) +# define AM_CHECK(dc) true +#elif defined(CONFIG_USER_ONLY) +# define AM_CHECK(dc) false #else -#define AM_CHECK(dc) (1) -#endif +# define AM_CHECK(dc) ((dc)->address_mask_32bit) #endif static void gen_address_mask(DisasContext *dc, TCGv addr) { -#ifdef TARGET_SPARC64 - if (AM_CHECK(dc)) + if (AM_CHECK(dc)) { tcg_gen_andi_tl(addr, addr, 0xffffffffULL); -#endif + } } static TCGv gen_load_gpr(DisasContext *dc, int reg) @@ -1366,11 +1367,9 @@ static void do_branch(DisasContext *dc, int32_t offset, uint32_t insn, int cc) unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29)); target_ulong target = dc->pc + offset; -#ifdef TARGET_SPARC64 if (unlikely(AM_CHECK(dc))) { target &= 0xffffffffULL; } -#endif if (cond == 0x0) { /* unconditional not taken */ if (a) { @@ -1406,11 +1405,9 @@ static void do_fbranch(DisasContext *dc, int32_t offset, uint32_t insn, int cc) unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29)); target_ulong target = dc->pc + offset; -#ifdef TARGET_SPARC64 if (unlikely(AM_CHECK(dc))) { target &= 0xffffffffULL; } -#endif if (cond == 0x0) { /* unconditional not taken */ if (a) {