From patchwork Mon Sep 9 17:28:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 826631 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp2130624wrb; Mon, 9 Sep 2024 10:30:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW2G2IH+QRalxLxrcEmlnFDtcIr76MP2rEhisOtrTVhsk705M2t/K8spnrEaLyfFwCMwuuD5Q==@linaro.org X-Google-Smtp-Source: AGHT+IFFdmxJBKeSJURMSky3/mtovm+M4zyZGnb+A1/yyZ3KCNl3JFQJfnALREG48U3P53hih7vJ X-Received: by 2002:a05:6122:1e13:b0:4ef:280f:96ea with SMTP id 71dfb90a1353d-50207c29857mr14122319e0c.4.1725903057738; Mon, 09 Sep 2024 10:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725903057; cv=none; d=google.com; s=arc-20240605; b=gwluscmF5I3ULLH1kqw4q2CpoZ9GYy9nC9kE9M3zyQtjR135GkANzWWnURLvhChUrD hC0cb08613AfKunvoNjUFoqzL6U1LN9VTB4sZsVslucRlMjjJTvOrjPPuozpG43MAirU eQCMz5F+epy68jpoNTqgT7mT1SOFmdEjYcUmuto/nJW0pNrLHw2T29iGtyte5FNacqLB Sh1IN0WfYv8YmDjpoq7XL46trRx55h3gTG86QWcusWxsTv7a0gmSVwTcPaCe6Z+1DlP7 tYPhacLJYYLMA6P6J0O5Ppi3Y+4wP0XFkkylR8I46VgbtNhuhNFiEMBs4P3xruejrjf9 bjrg== 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:cc:to :from:dkim-signature; bh=kAcKrDIxutgOniQxrMrD8IrQr2g9V6Cuwf+b/ddORiM=; fh=4bMsMJJHDmTQNFavmZaD/iTPOPK/LdH9YFdHoY+StpE=; b=b7NVdEfCeonsxCEIZ+OPro7PLxZAoJ5ytmmwgfGWUwI35qgG5m213y8/quHi2Y2UrP /AMBkYpkQpjl+yEdRjCXtiFmpfcdJi2sERqusAF9Nz0aaxCpOvh+fddS4DNyNlA2k7R1 S+fzfjLngtlSuYfLvEGUVf9sJA5rnSTyvEymN2sFkzfwJS4ry4hiBuW3qZun4IhzkKrg htyw5/ulhH1mTpE++t29jaP6KFG/kvf3IdswBxB3KHCJP3BRiWxE/Lu7Xrsc8wd1V2aW RIrLkGsxUmtnEP2bgLsphAVG5nhYshBlsddfVXUBXjyjjPIMFWmRem5C0f5N/dgQkg+3 0l8w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xmHK5xxg; 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 71dfb90a1353d-502c2586772si1135071e0c.264.2024.09.09.10.30.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Sep 2024 10:30: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=xmHK5xxg; 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 1sniC2-00055v-DY; Mon, 09 Sep 2024 13:28:50 -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 1sniBu-0004bQ-47 for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:42 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sniBs-00062j-BH for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:41 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2059112f0a7so42400765ad.3 for ; Mon, 09 Sep 2024 10:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725902919; x=1726507719; 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=kAcKrDIxutgOniQxrMrD8IrQr2g9V6Cuwf+b/ddORiM=; b=xmHK5xxgqmCgrrbW31S4Fi8H4dA24c299ub4zKKMyXXBI2a6KiG23iWlIiWtJPi39e cGjkH11Hkn7n6P/euh5+y3ziSK5w9X6E2oK82B8pmyNeztUwEsQrqOWItw6ws1QFRupQ jLVLiXAq2UeOuVndsUuoZhF5JAG7wVAg/zVyQ/rhGPLX6OYB8v9nH2KWbiRFAEwYLLdS VDMXceBdWbXkCN3M4ujzGMpMmTQsZasCT+EDKDiDsIqLou29fZAN587FXihrVyOQrsLq oVQ7FaWABvCTY4xjBZlr80t5afUSG8XU09lzCSy/BUv+RjCMPEddoLIBTFfZ7Yg8Q4kN ULrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725902919; x=1726507719; 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=kAcKrDIxutgOniQxrMrD8IrQr2g9V6Cuwf+b/ddORiM=; b=SgURsbjcOxM++vSfbpIKyUuf//ui+JMsd0GznL+PoQJiKXA8F+jmJsA6bw7n6xKYh9 IVauIWrN3b+jXvpyChYeIsGlzRoEJ9bzWh4pLW7W3dkW2aG6Ix4StQLKj/ns36XDwkEj e+8GBTsZzzgIhLvUc7CqX52N4ge8ZsRu6VjO9qK9nq6VwXeFonmMKG+fXvHvaDSK8VXP xksE8zoJGlB7ESSWMd399eKcjuc3+Z1JhW7wNfat+x5fOm+0og31rd3l7qU0kPD3Bk8v XRu+IY+GSwcmH6dN7yvPivDdVPXI3kRGKXetSNQ+iUMuf7ggPWwk5HFOJCn6xrD5dkZX +99A== X-Gm-Message-State: AOJu0Yz/g91pR0B/l3c6XZbzVTGTZQaKdCb+DzATKVwlnaXnN9R+NbeI OYtwOycIro6PcqQ0DmyebRocjNwa32DWFM5I+iKiABhZikfgHL1bUcH+9sw82HogAEhIEU/F5F7 n X-Received: by 2002:a17:902:e543:b0:202:2f0:3bb2 with SMTP id d9443c01a7336-20707020f79mr78328825ad.60.1725902918945; Mon, 09 Sep 2024 10:28:38 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710e11e02sm36539875ad.14.2024.09.09.10.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 10:28:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, daniel@0x0f.com Subject: [PATCH v3 15/26] target/m68k: Remove env argument to gen_lea_mode Date: Mon, 9 Sep 2024 10:28:12 -0700 Message-ID: <20240909172823.649837-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240909172823.649837-1-richard.henderson@linaro.org> References: <20240909172823.649837-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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 Use the env pointer in DisasContext. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 78a9358416..938c650c78 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -693,8 +693,7 @@ static int addr_inc_size(DisasContext *s, int reg0, int opsize) /* * Generate code for an "effective address". */ -static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, - int mode, int reg0, int opsize) +static TCGv gen_lea_mode(DisasContext *s, int mode, int reg0, int opsize) { TCGv reg, addr, tmp; uint16_t ext; @@ -732,7 +731,7 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, case 5: /* Indirect displacement. */ reg = get_areg(s, reg0); addr = tcg_temp_new(); - ext = read_im16(env, s); + ext = read_im16(s->env, s); tcg_gen_addi_i32(addr, reg, (int16_t)ext); return addr; case 6: /* Indirect index + displacement. */ @@ -741,14 +740,14 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, case 7: /* Other */ switch (reg0) { case 0: /* Absolute short. */ - offset = (int16_t)read_im16(env, s); + offset = (int16_t)read_im16(s->env, s); break; case 1: /* Absolute long. */ - offset = read_im32(env, s); + offset = read_im32(s->env, s); break; case 2: /* pc displacement */ offset = s->pc; - offset += (int16_t)read_im16(env, s); + offset += (int16_t)read_im16(s->env, s); break; case 3: /* pc index+displacement. */ return gen_lea_indexed(s, NULL_QREG); @@ -768,7 +767,7 @@ static TCGv gen_lea(CPUM68KState *env, DisasContext *s, uint16_t insn, { int mode = extract32(insn, 3, 3); int reg0 = REG(insn, 0); - return gen_lea_mode(env, s, mode, reg0, opsize); + return gen_lea_mode(s, mode, reg0, opsize); } /* @@ -826,7 +825,7 @@ static TCGv gen_load_mode(CPUM68KState *env, DisasContext *s, case 4: /* Indirect predecrememnt. */ case 5: /* Indirect displacement. */ case 6: /* Indirect index + displacement. */ - addr = gen_lea_mode(env, s, mode, reg0, opsize); + addr = gen_lea_mode(s, mode, reg0, opsize); if (IS_NULL_QREG(addr)) { ret = addr; addr = NULL; @@ -869,7 +868,7 @@ static bool gen_store_mode(CPUM68KState *env, DisasContext *s, case 6: /* Indirect index + displacement. */ case 7: /* Other */ if (!addr) { - addr = gen_lea_mode(env, s, mode, reg0, opsize); + addr = gen_lea_mode(s, mode, reg0, opsize); if (IS_NULL_QREG(addr)) { return false; } @@ -1109,7 +1108,7 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, case 4: /* Indirect predecrememnt. */ case 5: /* Indirect displacement. */ case 6: /* Indirect index + displacement. */ - addr = gen_lea_mode(env, s, mode, reg0, opsize); + addr = gen_lea_mode(s, mode, reg0, opsize); if (IS_NULL_QREG(addr)) { return -1; } @@ -1930,7 +1929,7 @@ DISAS_INSN(movem) break; default: - tmp = gen_lea_mode(env, s, mode, reg0, opsize); + tmp = gen_lea_mode(s, mode, reg0, opsize); if (IS_NULL_QREG(tmp)) { goto do_addr_fault; } @@ -2672,7 +2671,7 @@ DISAS_INSN(tas) } else { TCGv src1, addr; - addr = gen_lea_mode(env, s, mode, reg0, OS_BYTE); + addr = gen_lea_mode(s, mode, reg0, OS_BYTE); if (IS_NULL_QREG(addr)) { gen_addr_fault(s); return;