From patchwork Wed Jun 5 21:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 801652 Delivered-To: patch@linaro.org Received: by 2002:a5d:5610:0:b0:35b:5a80:51b4 with SMTP id l16csp48301wrv; Wed, 5 Jun 2024 14:59:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWjhBcQ9TIkK4K3Hy9K2jpRqCYj97jVQwZKGB8pezLvrxcSqW8O4KRvgt6Ar+nj/A9l/WZsPKY8G0hO2CN9EzUo X-Google-Smtp-Source: AGHT+IGlDrA1CnzSaXjkBEaTmUdfBdR3ZcEYDFCfkcX64t/0FRzWCbJFpiv1rgn9tWJaf9YI+82R X-Received: by 2002:a05:622a:242:b0:43a:fc66:35d8 with SMTP id d75a77b69052e-4402b57ef6dmr45021781cf.7.1717624742784; Wed, 05 Jun 2024 14:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717624742; cv=none; d=google.com; s=arc-20160816; b=OoqZhfzor+KOqOlXTQSoRaX6i2IbfA5erQ/Mk9ort7kko+vLzNR/xjh3egk/e6Kuii 27pFv+S3BqF21GS2A4NTxIn2QrwNhJS2TJQiY/Wmi0ZGhi1906mO1+np4soYOJ/8O4ll CcKBxGBM5Jj8K7Q+V2vs98XAjw18L3qQiwHk60PWFohP6jdEJhXa7SUvGdJbSnODEiBm UOjvd46FKdL2iS/wMndnlolorJZ0jz14IaHinbhw8Tv/ngbOdS7JUs2NMOs04tZrm+8D qJqdyoVgd9nVNWkTqDQdGAhXHJNZSlV2PhrETsQmzVyCNf7qBjKsWRc1hr2g9rVZk2+j vmcA== 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=RIX7XK6plrFAu/60k76Lx8FovOSuygKS6nD5tM+w8JA=; fh=NRM9GxiQu7lgoFWAiJmbRZwW47I3s36PXFnyEXFStLk=; b=Tri7ZHy3jcJZsKb1z74K3YHUqmLx43xs1yuJOS5blfayx4CkJrZ4FBz0RQiAaqB5R8 Lz277keb0p3/F+HGQRDTg5Mwh2P5lCzOnMS3I6HLu8obHbGdGLjVZGEQI60qP1zUO2uH ++cxPtMW0OPIshAfCbAAmqu4qh7mUGREBgbtiZYmF8NDibUvx1nP2c3KfwHmqWugwMi9 MIlBTNyj8WEh0PQJR6813BZDmpG2t7Wt/h8MpZ1fHrNYixc6uht/zpf1Zj0ebxnS/P7q X4/wIWXDitLY2JyPBfX4svWZ0VS784JsJQ27JbTcvVSg/BVSSvx1Yd+L+kztX8hs6OTc xtGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U8yR0Ady; 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 d75a77b69052e-44038a8760dsi864381cf.174.2024.06.05.14.59.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2024 14:59:02 -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=U8yR0Ady; 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 1sEydm-0001nq-2o; Wed, 05 Jun 2024 17:57:54 -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 1sEydk-0001lj-2i for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:52 -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 1sEydi-0003rs-C8 for qemu-devel@nongnu.org; Wed, 05 Jun 2024 17:57:51 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-70259bdcf7cso261741b3a.0 for ; Wed, 05 Jun 2024 14:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717624669; x=1718229469; 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=RIX7XK6plrFAu/60k76Lx8FovOSuygKS6nD5tM+w8JA=; b=U8yR0Adygoz+2OMobodqDy5ytuqB2BGur3yRNwmQgXIRi714uroQmLQFN7gdKxDRsv MJuJmWgPQdB9Zb12nJGS35ie2tn6GW6qzeZSVv8BlLMDr+5JGDGjrPo7bDG7MJhD0yJM WGf7V/OW9kDWZWcaBhqZRCTEByI1CCVNmqLos62i9b8P+eCQx2oXlBqIOxOKjyv3XeZ1 ZsVe4pgxbVPU6r2yGZv1WoX1Am3S8dSzdClPRdJmSO3r/NFB40cfdDSiOVoDvmSp52UJ bLzilRFux2KV739TCRsc0JJBuiuXXVgLPAHGEpBbmZCo0q0v1ZSGCFVBGiAwyiNyd7vM 5sgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717624669; x=1718229469; 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=RIX7XK6plrFAu/60k76Lx8FovOSuygKS6nD5tM+w8JA=; b=DjUiS9BsvsXw2423gtV2sftvtdmeSkGqY9vE4wvTAGiLbBTZgMwwkLcN9JfZN1ZVs5 4Zv46yOw9hShmHNENMVcdPXFMNnDyzTMQemoSUBKIYW/E79wSf+SIeJGqvruzjueoIIK Un8C34J7Fjy0gCmEnR0kjQ0Wrp35oPOOkmrc0HA5JtKOdpAnpxrElkqyRKn8i7OzKjvi k8kVq8NAvIzA14SJ06EDlWwmVsuZ6XUP4byh0JXdWH59zif2Ujxi+i70+8NCjb58dVdK /PpOOe1BhdyPjMHzDV1XDs+iLZ09C0mS0a+8NmX1oB+v3nKB2sc0T8DrtWBh4VlTLGdG vF5A== X-Gm-Message-State: AOJu0Yyp2a+JNY6neOVvUNLPiJbcdO+fKQCd/gZb+Jb5fqL5+ft7edez dtuLACo+XckZ0UIbQ33ODO7wlypcAR71GnYA1pD60jpjY9ZkxnqgOVsAqlDYPEUHqqYPnRRh8Z+ o X-Received: by 2002:a05:6a00:1146:b0:6f3:ea67:48c3 with SMTP id d2e1a72fcca58-703e56d308amr4297696b3a.0.1717624668814; Wed, 05 Jun 2024 14:57:48 -0700 (PDT) Received: from stoup.. ([71.212.132.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70242b2ff9dsm9091509b3a.212.2024.06.05.14.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:57:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH v2 08/10] target/s390x: Use ilen instead in branches Date: Wed, 5 Jun 2024 14:57:37 -0700 Message-Id: <20240605215739.4758-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240605215739.4758-1-richard.henderson@linaro.org> References: <20240605215739.4758-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Remove the remaining uses of pc_tmp, and remove the variable. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index bce9a0aeb0..3014cbea4f 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -141,12 +141,6 @@ struct DisasContext { const DisasInsn *insn; DisasFields fields; uint64_t ex_value; - /* - * During translate_one(), pc_tmp is used to determine the instruction - * to be executed after base.pc_next - e.g. next sequential instruction - * or a branch target. - */ - uint64_t pc_tmp; uint32_t ilen; enum cc_op cc_op; bool exit_to_mainloop; @@ -344,11 +338,6 @@ static void store_freg32_i64(int reg, TCGv_i64 v) tcg_gen_st32_i64(v, tcg_env, freg32_offset(reg)); } -static void update_psw_addr(DisasContext *s) -{ - gen_psw_addr_disp(s, psw_addr, 0); -} - static void per_branch(DisasContext *s, TCGv_i64 dest) { #ifndef CONFIG_USER_ONLY @@ -420,7 +409,7 @@ static void gen_program_exception(DisasContext *s, int code) offsetof(CPUS390XState, int_pgm_ilen)); /* update the psw */ - update_psw_addr(s); + gen_psw_addr_disp(s, psw_addr, 0); /* Save off cc. */ update_cc_op(s); @@ -1179,7 +1168,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, /* Branch not taken. */ gen_psw_addr_disp(s, psw_addr, s->ilen); - if (use_goto_tb(s, s->pc_tmp)) { + if (use_goto_tb(s, s->base.pc_next + s->ilen)) { tcg_gen_goto_tb(1); tcg_gen_exit_tb(s->base.tb, 1); return DISAS_NORETURN; @@ -2361,7 +2350,7 @@ static DisasJumpType op_ex(DisasContext *s, DisasOps *o) return DISAS_NORETURN; } - update_psw_addr(s); + gen_psw_addr_disp(s, psw_addr, 0); update_cc_op(s); if (r1 == 0) { @@ -3085,7 +3074,7 @@ static DisasJumpType op_lpd(DisasContext *s, DisasOps *o) /* In a parallel context, stop the world and single step. */ if (tb_cflags(s->base.tb) & CF_PARALLEL) { - update_psw_addr(s); + gen_psw_addr_disp(s, psw_addr, 0); update_cc_op(s); gen_exception(EXCP_ATOMIC); return DISAS_NORETURN; @@ -4379,7 +4368,7 @@ static DisasJumpType op_stura(DisasContext *s, DisasOps *o) if (s->base.tb->flags & FLAG_MASK_PER_STORE_REAL) { update_cc_op(s); - update_psw_addr(s); + gen_psw_addr_disp(s, psw_addr, 0); gen_helper_per_store_real(tcg_env, tcg_constant_i32(s->ilen)); return DISAS_NORETURN; } @@ -4611,7 +4600,7 @@ static DisasJumpType op_svc(DisasContext *s, DisasOps *o) { TCGv_i32 t; - update_psw_addr(s); + gen_psw_addr_disp(s, psw_addr, 0); update_cc_op(s); t = tcg_constant_i32(get_field(s, i1) & 0xff); @@ -6193,7 +6182,6 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s) g_assert_not_reached(); } } - s->pc_tmp = s->base.pc_next + ilen; s->ilen = ilen; /* We can't actually determine the insn format until we've looked up @@ -6413,7 +6401,7 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) out: /* Advance to the next instruction. */ - s->base.pc_next = s->pc_tmp; + s->base.pc_next += s->ilen; return ret; } @@ -6475,7 +6463,7 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) case DISAS_NORETURN: break; case DISAS_TOO_MANY: - update_psw_addr(dc); + gen_psw_addr_disp(dc, psw_addr, 0); /* FALLTHRU */ case DISAS_PC_UPDATED: /* Next TB starts off with CC_OP_DYNAMIC, so make sure the