From patchwork Mon Sep 9 17:28:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 826625 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp2130382wrb; Mon, 9 Sep 2024 10:30:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXoRhqk0pzYZgVf1vhOCtkaobTWO1GSGbnahb4Yxtz/MH6lEWDqkS1d7VeSD4aJxvhmFNsmHg==@linaro.org X-Google-Smtp-Source: AGHT+IFurTb7oSu7UE2dAbNogGAXO4rc/g+dr6K6A0u0F0kWZ6UdgaX3r7sUgEYTssAv7v1OTDo1 X-Received: by 2002:a05:6830:4103:b0:710:f50a:51e9 with SMTP id 46e09a7af769-710f50a53f2mr635576a34.20.1725903028537; Mon, 09 Sep 2024 10:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725903028; cv=none; d=google.com; s=arc-20240605; b=lheeKaQbxNs1d5glt9OuTRyPQCP/JxammBK9UOt4fQstElkwnz8rJ/1nhcHkHF6SiZ /GnW0l2zm1BxloTmO6kLWhGYPdOg8ISrlNlaWg8xZZLjS6q8TyuHY8zNCPL9KOelnLnE j7KuAPVDhZgwP4Tjq+QHZkt0mB5FUSztzXA+0DoCCbIg8anU1oSPEyl9JSLy7O0adQ6y 5VDbXvM387E/PFX/W99GmcFggMtVJ3CSMG0Mv2Hd/0oJLjxiLXbR2wCXMnXv2sQfBfoe nQ8dyLbTjSnRHh0d8Yx83UVkKqcdLq/uznzPcbSl6xwl3elFLc0l3sc5wpHgI68Lr3Zm sN7w== 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=gH4TiQd0zre/48UyAuTgFyxk/rLl6wXtwZdFEj9L1dg=; fh=4bMsMJJHDmTQNFavmZaD/iTPOPK/LdH9YFdHoY+StpE=; b=GmJ1GRmnwhc0xb5cVGQHXPDs68GksU7S6MAZCKZk9o/he/8wT+9YnOLQ2HlbXpxx/C 7Gp+ro1FRdEYYY52gnKISoM/KuJtrMoMfsSwcQ2CrEwhsHSor19ikj3rMa0tnIG8OWd7 mCirgKNkb1/pw0adxa56lb8XzWN4VvS/Au3jaeLd4CkOFeZZYG0uly8lJwZ2XGeNYawp C/ulWOqqjsLoyrso5HRPiupClOEFGTTTbk+eRAPKEEyK+1faymHhvdPyUDpVDadPYIic 2eie4x8tRm9CKIt/SPTv20GBYdyJj3qIBlFKalqIvXAUbAlMs37bxpcmCSzAXeRkLaq+ XgtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vmh9HKy2; 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 d75a77b69052e-45822fb036bsi56303641cf.613.2024.09.09.10.30.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Sep 2024 10:30:28 -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=Vmh9HKy2; 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 1sniBy-0004pC-5B; Mon, 09 Sep 2024 13:28:46 -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-0004dp-Mz for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:42 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sniBt-00062t-4d for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:42 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-206e614953aso36150965ad.1 for ; Mon, 09 Sep 2024 10:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725902920; x=1726507720; 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=gH4TiQd0zre/48UyAuTgFyxk/rLl6wXtwZdFEj9L1dg=; b=Vmh9HKy28zjmkGkxn/IbVLUoCMqwjRz7FY4MEPYjTFXSgbHNUeeCCFLzViNDB0Lll2 phqkEvm+BtX3bgRK6raw5y+DPVaz1exEHgzoKJDq50kSYnSAtmGNVQ2hHlqWPQnAfMmr wzPxEMtW/mosUd/USk7ygQw8L7XMy+bghhFxTUM975Ddipcwp1gCes7VZ855IaZ/2hGK pBXv9K/GnSTipDvjdgJFhxkA+J5GMiUHlm8W8chak+wCHLQrsblFmizkyWLfEUo2xKWA oUirWtR9IA3MdpG7I3mP4MvXEhz25LfN5Tt9GMizxWZa+1TIbZc7c0c3Zl25BwwHHUAf 9dAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725902920; x=1726507720; 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=gH4TiQd0zre/48UyAuTgFyxk/rLl6wXtwZdFEj9L1dg=; b=oIiP8gqLxitcw/BJ977sOKFs8upoQIHrdD40I3cAgLL1rg46JVT1ntLxyzTxETeJVg /cIoj9yVQanXw2JaD875qHBFZ635aeIRxnMyWuNRGVpdR6BK8QVLdOjKcuK4BkXGlJ36 AZZsv2wh9JBPu3/lAcI6sYbBKuDPbso67qBVc082i0hsyDV/lncMZCL9RdwVsArQaMZY 0lvPQx5Dbh81Rh9n/nnqH5SpOA74x8qNWpPEdxLkkc/tYEogX/VO0sord0o9cv9Ki4Qe ItC/Kq3+1097cUp2xWEHdxZgeDkPfoA6aX3zHOOMX4bkjKpk4CgIQXFyA/gQawJ90Thp AFUg== X-Gm-Message-State: AOJu0YzTCY6Om/HuFOs+gED55tlUn+Kpe6FXuPUigMoW6p59TALu+c9z Gh60quG/nhrPRHNSwY/kRrQIMo5TNQMwRqOlhH2OCpfCbQQWrqLiuT+kPX2+zFJBmKhHEuj/sdp / X-Received: by 2002:a17:903:234c:b0:205:8407:631d with SMTP id d9443c01a7336-2070c077244mr119400695ad.13.1725902919804; Mon, 09 Sep 2024 10:28:39 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 10:28:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, daniel@0x0f.com Subject: [PATCH v3 16/26] target/m68k: Remove env argument to gen_load_mode Date: Mon, 9 Sep 2024 10:28:13 -0700 Message-ID: <20240909172823.649837-17-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::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 938c650c78..a3452ace96 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -775,9 +775,8 @@ static TCGv gen_lea(CPUM68KState *env, DisasContext *s, uint16_t insn, * a write otherwise it is a read (0 == sign extend, -1 == zero extend). * ADDRP is non-null for readwrite operands. */ -static TCGv gen_load_mode(CPUM68KState *env, DisasContext *s, - int mode, int reg0, int opsize, TCGv *addrp, - int sign, int index) +static TCGv gen_load_mode(DisasContext *s, int mode, int reg0, int opsize, + TCGv *addrp, int sign, int index) { TCGv reg, ret, addr = NULL; int32_t offset; @@ -798,19 +797,19 @@ static TCGv gen_load_mode(CPUM68KState *env, DisasContext *s, /* Immediate: sign extend values for consistency. */ switch (opsize) { case OS_BYTE: - offset = read_im8(env, s); + offset = read_im8(s->env, s); if (sign) { offset = (int8_t)offset; } break; case OS_WORD: - offset = read_im16(env, s); + offset = read_im16(s->env, s); if (sign) { offset = (int16_t)offset; } break; case OS_LONG: - offset = read_im32(env, s); + offset = read_im32(s->env, s); break; default: g_assert_not_reached(); @@ -1323,7 +1322,7 @@ static void gen_exit_tb(DisasContext *s) #define SRC_EA(env, result, opsize, op_sign, addrp) \ do { \ - result = gen_load_mode(env, s, extract32(insn, 3, 3), \ + result = gen_load_mode(s, extract32(insn, 3, 3), \ REG(insn, 0), opsize, addrp, \ op_sign, IS_USER(s)); \ if (IS_NULL_QREG(result)) { \ @@ -1699,10 +1698,8 @@ DISAS_INSN(abcd_mem) /* Indirect pre-decrement load (mode 4) */ - src = gen_load_mode(env, s, 4, REG(insn, 0), OS_BYTE, - NULL, false, IS_USER(s)); - dest = gen_load_mode(env, s, 4, REG(insn, 9), OS_BYTE, - &addr, false, IS_USER(s)); + src = gen_load_mode(s, 4, REG(insn, 0), OS_BYTE, NULL, false, IS_USER(s)); + dest = gen_load_mode(s, 4, REG(insn, 9), OS_BYTE, &addr, false, IS_USER(s)); bcd_add(dest, src); @@ -1735,10 +1732,8 @@ DISAS_INSN(sbcd_mem) /* Indirect pre-decrement load (mode 4) */ - src = gen_load_mode(env, s, 4, REG(insn, 0), OS_BYTE, - NULL, false, IS_USER(s)); - dest = gen_load_mode(env, s, 4, REG(insn, 9), OS_BYTE, - &addr, false, IS_USER(s)); + src = gen_load_mode(s, 4, REG(insn, 0), OS_BYTE, NULL, false, IS_USER(s)); + dest = gen_load_mode(s, 4, REG(insn, 9), OS_BYTE, &addr, false, IS_USER(s)); bcd_sub(dest, src); @@ -3119,11 +3114,9 @@ DISAS_INSN(cmpm) TCGv src, dst; /* Post-increment load (mode 3) from Ay. */ - src = gen_load_mode(env, s, 3, REG(insn, 0), opsize, - NULL, true, IS_USER(s)); + src = gen_load_mode(s, 3, REG(insn, 0), opsize, NULL, true, IS_USER(s)); /* Post-increment load (mode 3) from Ax. */ - dst = gen_load_mode(env, s, 3, REG(insn, 9), opsize, - NULL, true, IS_USER(s)); + dst = gen_load_mode(s, 3, REG(insn, 9), opsize, NULL, true, IS_USER(s)); gen_update_cc_cmp(s, dst, src, opsize); }