From patchwork Fri Mar 29 22:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 784104 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp3429441wrt; Fri, 29 Mar 2024 15:34:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDmvb2EMZZ9sYRZwf1LzkqSIRnIdagQr+08N4Oshef0RG96EmRbn/c6wsW5GmE+XYJhvVjewLoKgxzbQzvbqDR X-Google-Smtp-Source: AGHT+IGtNwnQkiTFTYgcUzzQfEPh99tiHbmSevT9z8GtebBM5EZIQTmRZZc3vDMlSCo0E9z0cFd6 X-Received: by 2002:a05:622a:491:b0:431:7c36:7f86 with SMTP id p17-20020a05622a049100b004317c367f86mr3748884qtx.59.1711751639984; Fri, 29 Mar 2024 15:33:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711751639; cv=none; d=google.com; s=arc-20160816; b=jKzW1ALTyFTwFfAEaQosRS6aATjBpS1ElD7eTIEEthCaO3cwbOWVFN2lGAiZR0cR5M 4XTbFdfK4Y1q6GAfo44ptw7WvlXt6V+BUR58Q+yrmhWkeKdlCjP1c1ii4vXJPAUrnw++ /9ZuXE9D0Wq9M0QoVmxdSeaw/8ImUyV9aUDNi+chshI19lzHpgukR/xj1PH6UYpvp7Ay njBXNiz65zkLVOv2c6fF1bOjDRSdXGTXIuJyghgQy+w8tUhGylrNmodnWaoUQvF/4CW3 lkJAUFK2oAw7sFW2BgLSBnREA9RHlvPG9BmY1tzaj4BTmNPN0Pl1m3OVjgVOkKjYZAiQ Qpxg== 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=zvYdGosSJzx/q33wx/CPl4VQF18FxpEZiKeNYnXcRT0=; fh=wDljmxUHXfz9MGj2//jPHYRc53BMWF157v8rVKELrf4=; b=zhttxcHyYOWeqJkqDS960leyEd9XCT6WQlBBnPxKg6S5ufGia+kkgFhrrgjbGOkzOD jjwMAZVmgfhgmTq4TAa0QRJRwcfOIo27YeCNH0eBsh4uga2ikp1sYKvbgZZgIvJAljmg 7Ov8b+WbPhx5LbWVnYlz18jd5LwhZ8/4gnNv3lD7aWZ1rAV/5a6ajs9/FEJq+BOmGtap cijusnkYEmXCy8HulrPk09w9noa9gtesku3HX1JtUEFdSv097Pw/wSP645rsztv25ksu lqz4MnQ7mnNYy/HZIXRSnKSyF20xtqgS6YO6QFv3Q5DW2iY7wzO1ijZ+i20OQgVhV1Qc QVsQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uW0yAgHd; 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 w4-20020ac857c4000000b004316011e2ffsi4769032qta.511.2024.03.29.15.33.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2024 15:33:59 -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=uW0yAgHd; 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 1rqKlR-0002gE-Jm; Fri, 29 Mar 2024 18:31:57 -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 1rqKl9-0002aO-0D for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:41 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqKl7-0003Xv-FA for qemu-devel@nongnu.org; Fri, 29 Mar 2024 18:31:38 -0400 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5d8b70b39efso1864554a12.0 for ; Fri, 29 Mar 2024 15:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711751496; x=1712356296; 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=zvYdGosSJzx/q33wx/CPl4VQF18FxpEZiKeNYnXcRT0=; b=uW0yAgHdKw3RL8yHmHUuVMeIb2CnAfgQLKTUWz3/Lk8NT0kc2u7170bwQOVT4UPDAO 0EIHiQ55XPN5MZnCXiqWeDBOMlvKIVCIg4KFnegpxKGzM/rdgLaSTvgbxK++LC2xB0sO 9p5nZtm3bQ7+C2I55nuSB+3mjb8w9fUPvEv6CMhKGnGQJDDYyeICTuZAYTHnhaDqHoM5 7F4OSBuasxx5oZz4hn0nV9ejrzQwBwM7Y0+3qcRQWJkUZQIDwkiys3Ns3VnVXt/IeTSq C7O/jiiJrupnyORjsEu0ZRk63LmfQgtdqwicq6I78nUUFGVF7Bq7xNzp263r4TX/cSBY H6VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711751496; x=1712356296; 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=zvYdGosSJzx/q33wx/CPl4VQF18FxpEZiKeNYnXcRT0=; b=ps6e/Fa/syplU72dBjAkEWL45n0wDibo0sMdgPfG8mrADPbIJYBYbFG9CPgCv7e0Db SCumxjeje+/RSIMs0ntjwEDN1m6zqjqNkRiX5pVIjh/zUu2HMIQe5yr5mvUhKVuAWJsB e5Pj3VjFeVOiHXldJG3x0qBb0UQXP/PCFoUHLuB59gHCHmFRj0jZe3huueXi64NzuQmZ fyMqyPkrGyVw1r6SWRaTVX2BNQySlzSwA0fhcPrseF5I4fBQR+dBdDW/jTpZ+R0/XfRA C16XetZ9N7id5z+CqqkCSHGphUiBZ4WeYWoJnavs5NCd1p+D7LY8Y21HZzz59PIdY4Lg J5xQ== X-Gm-Message-State: AOJu0Yzno7sK/sIizEeIxPI/1KPSxAxcxWKShxHAreW3GaEVZarVhN5+ fZ8VrqAWu5Joy2739CN0rNaiL3xRmvlJP0DWAi/7XhQNgW1S3qEt7GrSms6FgQpCX5dAoRXBPmb E X-Received: by 2002:a17:902:db0e:b0:1e0:fdc6:e4d3 with SMTP id m14-20020a170902db0e00b001e0fdc6e4d3mr4170025plx.49.1711751495975; Fri, 29 Mar 2024 15:31:35 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id f8-20020a170902684800b001e09b636cafsm4000955pln.287.2024.03.29.15.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 15:31:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Helge Deller Subject: [PULL 15/18] target/hppa: Generate getshadowregs inline Date: Fri, 29 Mar 2024 12:31:08 -1000 Message-Id: <20240329223111.1735826-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240329223111.1735826-1-richard.henderson@linaro.org> References: <20240329223111.1735826-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 This operation is trivial and does not require a helper. Reviewed-by: Helge Deller Signed-off-by: Richard Henderson --- target/hppa/helper.h | 1 - target/hppa/sys_helper.c | 4 ++-- target/hppa/translate.c | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 8fd7ba65d8..5900fd70bc 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -86,7 +86,6 @@ DEF_HELPER_FLAGS_0(read_interval_timer, TCG_CALL_NO_RWG, tl) #ifndef CONFIG_USER_ONLY DEF_HELPER_1(halt, noreturn, env) DEF_HELPER_1(reset, noreturn, env) -DEF_HELPER_1(getshadowregs, void, env) DEF_HELPER_1(rfi, void, env) DEF_HELPER_1(rfi_r, void, env) DEF_HELPER_FLAGS_2(write_interval_timer, TCG_CALL_NO_RWG, void, env, tl) diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 4a31748342..208e51c086 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -95,7 +95,7 @@ void HELPER(rfi)(CPUHPPAState *env) cpu_hppa_put_psw(env, env->cr[CR_IPSW]); } -void HELPER(getshadowregs)(CPUHPPAState *env) +static void getshadowregs(CPUHPPAState *env) { env->gr[1] = env->shadow[0]; env->gr[8] = env->shadow[1]; @@ -108,7 +108,7 @@ void HELPER(getshadowregs)(CPUHPPAState *env) void HELPER(rfi_r)(CPUHPPAState *env) { - helper_getshadowregs(env); + getshadowregs(env); helper_rfi(env); } diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 6da9503f33..29e4a64e40 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2385,14 +2385,23 @@ static bool trans_reset(DisasContext *ctx, arg_reset *a) #endif } -static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) +static bool do_getshadowregs(DisasContext *ctx) { CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); -#ifndef CONFIG_USER_ONLY nullify_over(ctx); - gen_helper_getshadowregs(tcg_env); + tcg_gen_ld_i64(cpu_gr[1], tcg_env, offsetof(CPUHPPAState, shadow[0])); + tcg_gen_ld_i64(cpu_gr[8], tcg_env, offsetof(CPUHPPAState, shadow[1])); + tcg_gen_ld_i64(cpu_gr[9], tcg_env, offsetof(CPUHPPAState, shadow[2])); + tcg_gen_ld_i64(cpu_gr[16], tcg_env, offsetof(CPUHPPAState, shadow[3])); + tcg_gen_ld_i64(cpu_gr[17], tcg_env, offsetof(CPUHPPAState, shadow[4])); + tcg_gen_ld_i64(cpu_gr[24], tcg_env, offsetof(CPUHPPAState, shadow[5])); + tcg_gen_ld_i64(cpu_gr[25], tcg_env, offsetof(CPUHPPAState, shadow[6])); return nullify_end(ctx); -#endif +} + +static bool trans_getshadowregs(DisasContext *ctx, arg_getshadowregs *a) +{ + return do_getshadowregs(ctx); } static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a)