From patchwork Mon Feb 8 02:37:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 378448 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4315391jah; Sun, 7 Feb 2021 18:56:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTVYzAsP/axPVjjv+Jcbtusskd6UiZTB1K3WVh6yCCtzyf7kmI7bwmv28DLlk77paHSIk2 X-Received: by 2002:a25:2693:: with SMTP id m141mr22632980ybm.104.1612753015180; Sun, 07 Feb 2021 18:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612753015; cv=none; d=google.com; s=arc-20160816; b=dOqJcfm+Q6A0NaORrLkq8aapBQV20uz8Qw5Jcgm8mLdntrvmqzOlpOaWkTmZYVYcxE 6M9ybN0xCZpkoqdw+0AmTv2v42Pl0ZNAyv9cJZtO648pZs4RC9NCSZnCzXQJfV8vOI0k n0s6HCjYVY4HMtr+CIq8nkD4n3Rs5cHM652ra2Ndtc2FEqoeAn3gW625qKkWAb2ZtBeo Mkcy353h4ot0N7LfVheUzGaryGg5OcJlEEzlYYatMj2q9QEbH17yUDy8NH2rgZIEivdK kiQNLbWdJSP2hdCsxN5KSrqPrJ5+/bJsVm3cg/L5/P/DO8mje4HJaPfC1mUJYvRsc3IU ZlZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=gAtMoDd2i7XY269Vt3GidfUed6G50p5IEZQnuzdHWV3OcGqOMnutOVXzlTaP4TSBQw PjpQQ6I1bMpG2FMARo8PxlIQYKmHT67QxoXxOfsbj/hKjNYlzGnEe/j4D7s1PiUn3OHq AaOSgzt67DkPWc8ZtMvMr/Dqa9h7JfraBdVYd3eHG8kescEJhui24VzC44g0tEq+dEhf kc6fqj/k42rUVJJNUeQE+f0LZ6h6EAX/l2qo80rzR3iDfMOxk8nX2VlecT9oRBBdK5Jh s3yQwrMbg5n4zHEU+DZy/awrXowKyxzrWABhFPKlTemgzuP/NaULBFn/sFmzw43KNekE po8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pWL7H9hE; 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 8si15331111ybp.331.2021.02.07.18.56.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 18:56:55 -0800 (PST) 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=pWL7H9hE; 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]:48868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8wjO-0006GY-L3 for patch@linaro.org; Sun, 07 Feb 2021 21:56:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8wRb-0001Yh-3t for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:32 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:41665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8wRW-0005qf-1S for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:29 -0500 Received: by mail-pg1-x52a.google.com with SMTP id t11so5570378pgu.8 for ; Sun, 07 Feb 2021 18:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=pWL7H9hEEv0rCPdlXxCLhRke4wA+OnIBdCisMs5kdmtNjjndI2jOUdvGeNE7TYHvTT dZyYKxHv15NrUFW7jN48jTR0DGHdMNw7CmKJLtEkP42EMbvv971GU+59RPf6f+lwqXgv iuD9xGDs7lpz2WCwKMGObX9bPOv3fc2CZi6NWNTFUeuMICAC/8a3M34u6dR5KeM2sGW+ UMuNcAi3F1+QgoV41rijpWNMpIL2U+rhLQSB400VC686U2wl/iaYQUX9FGvCq1oY8jwP BqJPb5dCLB4cVKN0Z5miRIAcqJYJfmO0Yh7TDN+3BZhhsNGgbh5DXVFBglqCWi4EUN1P f8LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KzQlyAD9k/hiBg8OA6mTnZcwGe7ZwxIZNF3j/mJP4ic=; b=nkxJdFDY98vSStdRmhTAN/RAuPgpJl4DoV0Qhwl1CTDMSZ069opiIRULwbHYtYCRRV IYxodotYa7XF3AYvJ8lg90b1ZXKV/2LLqFK7i0xMSdLv4Gjlse7r01iIsu617pZ5xrgm 0CURxQrMsydXfLXzEna3wJbwu5q1PBYV/Kj1dR9jFvzd9HDrEPu+UI8L7MRayklQLuU9 55TQrRHF85phIwYR/X1Vu9842L+ORtiWAiFjfdYw/Mezl3FlBU1XDecIs4ply2sIW1nW UeT8P5D7hcNh3bYZzvfZS7n4LA7CQ4HXKtZ7qMWv5YSht/Ud8YjunAuvAodRHH/CfwUk xZ+g== X-Gm-Message-State: AOAM53168bbfWQohxRFUb7F173M2S7B83Ddm9z4kqPBs5Sur9BEPztd4 yTy8Jka9YqOnXuUXoLcSCgC46hRNX863fw== X-Received: by 2002:a62:92d7:0:b029:1d9:1591:e1fe with SMTP id o206-20020a6292d70000b02901d91591e1femr11541574pfd.72.1612751903934; Sun, 07 Feb 2021 18:38:23 -0800 (PST) Received: from localhost.localdomain (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id j17sm16158689pfh.183.2021.02.07.18.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:38:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 24/70] tcg/tci: Split out tci_args_rrcl and tci_args_rrrrcl Date: Sun, 7 Feb 2021 18:37:06 -0800 Message-Id: <20210208023752.270606-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208023752.270606-1-richard.henderson@linaro.org> References: <20210208023752.270606-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index 692b95b5c2..1e2f78a9f9 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -212,6 +212,15 @@ static void tci_args_rrs(const uint8_t **tb_ptr, *i2 = tci_read_s32(tb_ptr); } +static void tci_args_rrcl(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1, TCGCond *c2, void **l3) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *c2 = tci_read_b(tb_ptr); + *l3 = (void *)tci_read_label(tb_ptr); +} + static void tci_args_rrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGCond *c3) { @@ -222,6 +231,17 @@ static void tci_args_rrrc(const uint8_t **tb_ptr, } #if TCG_TARGET_REG_BITS == 32 +static void tci_args_rrrrcl(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, + TCGReg *r2, TCGReg *r3, TCGCond *c4, void **l5) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); + *r2 = tci_read_r(tb_ptr); + *r3 = tci_read_r(tb_ptr); + *c4 = tci_read_b(tb_ptr); + *l5 = (void *)tci_read_label(tb_ptr); +} + static void tci_args_rrrrrc(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, TCGReg *r2, TCGReg *r3, TCGReg *r4, TCGCond *c5) { @@ -405,7 +425,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tcg_target_ulong t0; tcg_target_ulong t1; tcg_target_ulong t2; - tcg_target_ulong label; TCGCond condition; target_ulong taddr; uint8_t tmp8; @@ -414,7 +433,7 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, uint64_t tmp64; #if TCG_TARGET_REG_BITS == 32 TCGReg r3, r4; - uint64_t v64, T1, T2; + uint64_t T1, T2; #endif TCGMemOpIdx oi; int32_t ofs; @@ -611,13 +630,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i32: - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare32(t0, t1, condition)) { + tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); + if (tci_compare32(regs[r0], regs[r1], condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break; @@ -637,13 +653,12 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_write_reg64(regs, t1, t0, tmp64); break; case INDEX_op_brcond2_i32: - tmp64 = tci_read_r64(regs, &tb_ptr); - v64 = tci_read_r64(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare64(tmp64, v64, condition)) { + tci_args_rrrrcl(&tb_ptr, &r0, &r1, &r2, &r3, &condition, &ptr); + T1 = tci_uint64(regs[r1], regs[r0]); + T2 = tci_uint64(regs[r3], regs[r2]); + if (tci_compare64(T1, T2, condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break; @@ -783,13 +798,10 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif case INDEX_op_brcond_i64: - t0 = tci_read_rval(regs, &tb_ptr); - t1 = tci_read_rval(regs, &tb_ptr); - condition = *tb_ptr++; - label = tci_read_label(&tb_ptr); - if (tci_compare64(t0, t1, condition)) { + tci_args_rrcl(&tb_ptr, &r0, &r1, &condition, &ptr); + if (tci_compare64(regs[r0], regs[r1], condition)) { tci_assert(tb_ptr == old_code_ptr + op_size); - tb_ptr = (uint8_t *)label; + tb_ptr = ptr; continue; } break;