From patchwork Mon Feb 8 02:37:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 378443 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4314251jah; Sun, 7 Feb 2021 18:54:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaBXoH7iB5YOjnBm04UJI/N6nzLHL5Gif6oYz8Bhzh8fLQeTL+c/yfXLOWTlGOEna/VufB X-Received: by 2002:a25:bec2:: with SMTP id k2mr23051065ybm.42.1612752842351; Sun, 07 Feb 2021 18:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612752842; cv=none; d=google.com; s=arc-20160816; b=JTSfPG5rKAkU4a0tMd5/PbtQwgS5U/D4YHLlATSjPVfLrT4j38K0BwSJcrWoTf8aNa sIurtQwaviLZU6iCWgFFMqlkPflhswFU10N2JpzwOpz9wOS+zzi61FVQPTsn+nFPPWED JpNp3lU9A/0SFDjOKFNZwi9iqDCoxJXCLrpGZ9d6u2+XE+mK8tk0G/psVF4KdXf5tEXV 15Yrrx8//XqKumJ22G+RIrpwhXr2yyGpl88rjQRhtFv+5bd1lr0QKzaYAzKyRfIYLUU2 B3t+zSIAGV8cuVxEuzCEMeewfkl4wVzH+6WzcJKWSUkANg7i7YAh+jIcLfSOddOlgN5I tiSA== 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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=Tv4hkcRLPo5Yc+pBdQR7PBiHeICgM5Jfffu7cVsZ28YilaxaiDCg0Y9zWbA2jNE9XX W6HvKjd4q3wextaMd76mf7BV68pChTx7PdKOYeKibv5DiUI25OWvdBJs4/zH8JlY9C7W R/TrsDpIsHjiL6Btq6xordm4cOPOUXJU8xJ4VxsiQPrAzOR9uEfkO2F3GYMx5+o1dgLt IPLkruztemaXweLsSbkS8QiGLIL+3ZUTLAa7CAuPpqx0FXHV5IXwQEfux9MxgicKyw6s /08khonqhm/A9aaMTb9BUQOEQV11VTFuRqPFwgHj7XInTDiZVkGHr1fmiuf6RHhyyPkP MKfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u+DHUaus; 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 j13si15934746ybh.229.2021.02.07.18.54.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 18:54:02 -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=u+DHUaus; 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]:39578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8wgb-0002Ij-QH for patch@linaro.org; Sun, 07 Feb 2021 21:54:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8wRR-0001VM-EP for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:21 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:45752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8wRO-0005oI-TE for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:38:21 -0500 Received: by mail-pf1-x42f.google.com with SMTP id j12so8736229pfj.12 for ; Sun, 07 Feb 2021 18:38:18 -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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=u+DHUausGSg2Zb5HYzAPBdVlGVT7Mw3m2Q6EO/akMZKT7SPOvSFpdGLR7mLqzNtkjS WBF85W9rOTnWly+GxiSvt0p3cl2eQZtqZLP0U7wAgbj11XmTwn2GLswlzSooUm9t6ghp bhJrpIf1V/ap0/Iqj4RLPztHY1DHGJsk8Z5M0/IBv5TC/dr2nnwp32TJoQy6gUHAHxQk 7louWn/ne8qRtmDVATluP2MmM+Yzs/aUZzOIef+dRIFuUMA5UQ4/M4CioSD3OMmW4yl1 /Xf/sc/sHcOsKqolDVhtqUCnzH4c/db8zOlyYgpHETnokhfb3ox8o0L4J5zG2aI3urp2 rBtQ== 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=SycMd2jWeSgxswrzk2jq/EmJnAdi6ZgvEeestJkdRLA=; b=MDnDJX6VVM0jAbVJFgghoKCHrFiLbnJV0X7QXbJaqzzUnWjBg4vNwFTeWSmqz9BUIK oMXLjF5VHPig2d2lSB7esT9pRmvkFJ6ynOKHuLY0epQzqOE6MYbnNgF9BDLBuJxqgsHE yI9pAT0RYdQWKDdTtdFaGXm6ytMQbFknpBQwg5w5qpe2y/qNVxjo9QjvVW6ZO/zlj0TA f3zElLqCkk/S6CQLosVGo9xhrfqgPtM3qxaRM4/grb8PU43v0D//UK9iP3BGKqa+xP2Q kGR+HPkBCZkOGmOY/HKDLLEG/moAqQS0i8jvBGnuzh9Kw3tIz0Z3Ti4spS6cq/AErjz9 MaFw== X-Gm-Message-State: AOAM532FwdTKrhdibBZ4wUcGeFnvq0AYI+j6kaJBntT4yeX9YixoEBBB ymvGIAnLNkAOY28nm3VFaDU1jABfcxFoVA== X-Received: by 2002:a63:e101:: with SMTP id z1mr14879027pgh.190.1612751897630; Sun, 07 Feb 2021 18:38:17 -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.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:38:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 19/70] tcg/tci: Split out tci_args_rr Date: Sun, 7 Feb 2021 18:37:01 -0800 Message-Id: <20210208023752.270606-20-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 | 67 +++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tci.c b/tcg/tci.c index be298ae39d..0bc5294e8b 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -184,6 +184,13 @@ static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr) * s = signed ldst offset */ +static void tci_args_rr(const uint8_t **tb_ptr, + TCGReg *r0, TCGReg *r1) +{ + *r0 = tci_read_r(tb_ptr); + *r1 = tci_read_r(tb_ptr); +} + static void tci_args_rrs(const uint8_t **tb_ptr, TCGReg *r0, TCGReg *r1, int32_t *i2) { @@ -439,9 +446,8 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; #endif CASE_32_64(mov) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = regs[r1]; break; case INDEX_op_tci_movi_i32: t0 = *tb_ptr++; @@ -652,58 +658,50 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, #endif /* TCG_TARGET_REG_BITS == 32 */ #if TCG_TARGET_HAS_ext8s_i32 || TCG_TARGET_HAS_ext8s_i64 CASE_32_64(ext8s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int8_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16s_i32 || TCG_TARGET_HAS_ext16s_i64 CASE_32_64(ext16s) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int16_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext8u_i32 || TCG_TARGET_HAS_ext8u_i64 CASE_32_64(ext8u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint8_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint8_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_ext16u_i32 || TCG_TARGET_HAS_ext16u_i64 CASE_32_64(ext16u) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint16_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint16_t)regs[r1]; break; #endif #if TCG_TARGET_HAS_bswap16_i32 || TCG_TARGET_HAS_bswap16_i64 CASE_32_64(bswap16) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap16(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap16(regs[r1]); break; #endif #if TCG_TARGET_HAS_bswap32_i32 || TCG_TARGET_HAS_bswap32_i64 CASE_32_64(bswap32) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap32(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap32(regs[r1]); break; #endif #if TCG_TARGET_HAS_not_i32 || TCG_TARGET_HAS_not_i64 CASE_32_64(not) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, ~t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = ~regs[r1]; break; #endif #if TCG_TARGET_HAS_neg_i32 || TCG_TARGET_HAS_neg_i64 CASE_32_64(neg) - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, -t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = -regs[r1]; break; #endif #if TCG_TARGET_REG_BITS == 64 @@ -816,21 +814,18 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, break; case INDEX_op_ext32s_i64: case INDEX_op_ext_i32_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (int32_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (int32_t)regs[r1]; break; case INDEX_op_ext32u_i64: case INDEX_op_extu_i32_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, (uint32_t)t1); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = (uint32_t)regs[r1]; break; #if TCG_TARGET_HAS_bswap64_i64 case INDEX_op_bswap64_i64: - t0 = *tb_ptr++; - t1 = tci_read_rval(regs, &tb_ptr); - tci_write_reg(regs, t0, bswap64(t1)); + tci_args_rr(&tb_ptr, &r0, &r1); + regs[r0] = bswap64(regs[r1]); break; #endif #endif /* TCG_TARGET_REG_BITS == 64 */