From patchwork Sun Oct 22 05:59:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736947 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1004453wrl; Sat, 21 Oct 2023 23:06:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYRr5cC8oCBf1Zci5er9E7e0Fyva+D5p8BPddxG1ShU1W8Mx5hge28SSXdTtiGugizM0xg X-Received: by 2002:a05:620a:4256:b0:777:5e79:d280 with SMTP id w22-20020a05620a425600b007775e79d280mr6824352qko.53.1697954817525; Sat, 21 Oct 2023 23:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697954817; cv=none; d=google.com; s=arc-20160816; b=KH4Z2Zkjugq2yZhZO7O2qc+FtYRcncae8fR7msV4qUv3bKTX20oNAs5hZqYP5t6wEc 7WU+f3Cf4lh3EWq/vTkevvBKLOyPyWWqoNyh1ROfMibSQ93as9vveUSNIEh5BtZV0hxX czCCVaJaFmg1ZSf1PQmh+b5Dy8DV9KrRtePrZ2Akf75Y+G7lrCyIRAQ3kU/qB9o370s1 6vGM58qg7N4sa+giWhnL9KsVtyRW2Xona0kNxeWTEN/199bp1xg4ZYlOrftrBJSacXte TAMUuWkQsK0ouZkrv5+m981SLKSNWwnvFrh1JNL8U5m9ixaYzdEAIUDvQryDGMjQYzwW UijQ== 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=vNn7jVogYLYvnKzq1R44V4cOiOcSGXgz1/4pjUiWR3E=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=PAwm4u+SKufgr/w6Z2OX+rSZSG5eUYV8t/OaI8w3+CinnRWc5Lv0DmQP8zCI09JAIS pfxGlSlSEchkKrh9ItGCezERG4w+8VxQCu9OTmOHsh+VNE+z9p6ymRpkR3TpXYXEb9FG m6ox3HixIPUw5/X8EmU28INSL2jPClf6ShJ709IJxHP2IAk/ebWEEhpyopHtqxSmJ9Dd Ac0xc4WHw7l9ZxJwqI8X/IiGt1pph9SStsMSNqzPwvACEDW0D83wXlzLWzCXmd/w5SdY 2tcJSM1VpgQcfcGqsghs1gglXbdBGY+TaRMnZgM/4bCxQhkWDZDd30ejtNV5L48mxlpx iUnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zpYh/Dy9"; 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 j18-20020a05620a411200b0077053731daesi3726349qko.261.2023.10.21.23.06.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:06:57 -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="zpYh/Dy9"; 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 1quRW3-0000VT-39; Sun, 22 Oct 2023 02:00:47 -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 1quRW1-0000UI-Kq for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:00:45 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRVz-0001Wh-7s for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:00:45 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6be840283ceso1740394b3a.3 for ; Sat, 21 Oct 2023 23:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954441; x=1698559241; 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=vNn7jVogYLYvnKzq1R44V4cOiOcSGXgz1/4pjUiWR3E=; b=zpYh/Dy9C0U4Sjxld20/Pul5bf3vFbZvvJhjHBlxr7OnhxCmqQmXsgTorGzt3+d9/F 3VLlotZa6awYI2tulF3rSaEEvmPza4KOzX7eyRAy7j7jUM76g/1qYR8yaQd5/OR38xt8 rnJgYepIbo6Q8zsqIlnByYCPYnxwCrXeYNCDRS3/Cf4p1mJu3CVep8SoRhrUfeBfA90n Kl/f07CKITpdwTx+seKgdFuutWn/HhZPVZQnoLr2M5WoLMWVt4BYNEWwvss2BlQVQmTp 43jzuZ8JAYuvPJqf2MVdzU40cpctSTuc0AuE4t3HsQV2LKxSpAs4gfg19XASChjthkGb wyUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954441; x=1698559241; 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=vNn7jVogYLYvnKzq1R44V4cOiOcSGXgz1/4pjUiWR3E=; b=RucspMMg/bjDHPPnPMB4YkY8UAxwSrzBj9EY4kyApIdYRl7Cnflk/qAtLmA65krPON j3FBs95Exnl+h3hy5VSgcuIcM+yal6ldBre4gz6w7+1hHePD8qNo/to0SrlUl/RBarm7 R8EoTeiYwpBg12v4NApmnIzMIqSM0xmRimdLGu8iJp9fFQwHTLP4S4VT5vCLi5+khb5Y frZlB1ef96PnpybEpgrdvp/jY0+M+hKqWS6WrnEfIWYx5oJUBmIGM9iqCipKAUK6CtZZ z8+ZJmpMq5cdSlbUpf3pxdkdf5ikEB2lKlsTLAWFyApe1I2KhKXq+/mqrZPYOdb9t5D2 NjVQ== X-Gm-Message-State: AOJu0YwXNQxfyT2sqsvSpSEpmTmpVYkMlmzeOZBZR+TmY6+OMSVL3on+ sbZGjKB9TFGbsU+/2f6TWVDMTEUAYCmN99Zwg7Q= X-Received: by 2002:a05:6a21:a5aa:b0:14c:c393:6af with SMTP id gd42-20020a056a21a5aa00b0014cc39306afmr5267383pzc.0.1697954441527; Sat, 21 Oct 2023 23:00:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id je17-20020a170903265100b001c728609574sm3999887plb.6.2023.10.21.23.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:00:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 10/90] target/sparc: Define AM_CHECK for sparc32 Date: Sat, 21 Oct 2023 22:59:11 -0700 Message-Id: <20231022060031.490251-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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. 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) {