From patchwork Thu Feb 4 01:44:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376186 Delivered-To: patch@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp913657ejt; Wed, 3 Feb 2021 18:21:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEmoUvtySCmU84Cqr3Z298ffxbiaObLpQqi4abzFvzUdAu79ev54VX38ru9Yx79VfA473Y X-Received: by 2002:a25:34c3:: with SMTP id b186mr8371317yba.325.1612405301954; Wed, 03 Feb 2021 18:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612405301; cv=none; d=google.com; s=arc-20160816; b=QdjE1vOpgjisehEu6qwecRwiLNn7yhNHad2S+WkGfkH4xY7Nc8Ku9WYW6jCNIuP/Os yje+GJM9WXbenoeEOMJlA0MCMSlP+zqAaiIdZxo/XfbYTCa+ak78RlSVue0kzN/eQ7Tz GbOSpNuHC5okVIsZEimU1zjQ0JD90EDIH9Gblos57C42jFH1ltQIP+l0fNrb3qoX72oy s1mNmgwBrJOpxpsnZO0uuSE79oH6l3u0gTo8xVnnDr0hL3BgDNrzSsE5V3WfJ8+0EX5p bE1+waWD4NOUk4u+7XrGRr6YnRv9ObcDPhSIuVyUqQeCaAbJljDae6oVvpAwX4+CwpfF v2ZA== 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=ZUSADsxswAIECqB/PfVGNxjJd6K0DO3CiMULL9Q2MSzqCb8lwUvV8N/TDQkSc+7g8g 74KHQmiHqGMN5NlwfjTnaVy9XYtS4bzZWCt5ViKz4VCJJaUh4RY6+S3r/d2ZFrUYWmHV ao43qlcsQ+V4TvGsWsQgDMLrvqCFlGAL/QzvrMaMsae4dpPkmCxIShCQJE0pkTfkhDMi FbyXgKN1Y6FKKEmtFy33CBGf/xBlmj0xvW5oGyqwPUd+JRFIFZ8bM9GV94PgVD62Tdwa 4adB0osGzZVzJm70oj8u8AHKeaI0AMjuICIva8v338jgvkQkMoScH8nlrwnwWOpqZmQ7 cHFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LcynX8ps; 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 v9si3923883ybs.141.2021.02.03.18.21.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:21:41 -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=LcynX8ps; 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]:43216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UH7-0004Tw-A7 for patch@linaro.org; Wed, 03 Feb 2021 21:21:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7TjJ-0005Qf-Bs for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:45 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:40616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tj8-0003yd-QB for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:46:44 -0500 Received: by mail-pg1-x52f.google.com with SMTP id b21so1028664pgk.7 for ; Wed, 03 Feb 2021 17:46:33 -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=LcynX8psXkzYNk3VoqoKQOagTyVjc12L4P6IvTI6/+BN3EwSwjgvHlydoGWzwE2KZ0 q4i5Z2FI5IiIsaIH0TUciUybrAAoPrCHSifCyxbMvzgwFN7qr4hHypUNVUHyDOILMXvX UYtre4vvp3Y3BO7VMFPu7IuZ0pno85Fz5nXLHM+E+NUh0iJYvKgvqNih5+mc2iOyPhSx EAfBJSddK0YCkx426ch7EJcAbONJZQhxAmLH1MrivIg3z4lErwNMXmjh+biZOuQHH5/o d/DT2FlzMf2xn55tgd7Mwvfv+WgzL6RdX/coIXfcVyPpqaskmMJpunOHAa1O1kg/Mcck si/g== 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=RSwhlJ3cVkxCEQ56KoblO7YtOGQMS4Eh8gMPuNDQqwqUsWTwHvrfKW6cdCOe1Nd5Yk I8AW/9Cw5vVCoJBiaNkDdpk09d+lKCVzVoyicHcHA7KCulrIJH20LpmhvwSCcHQDUc99 6AKvJNm6RNo6mnMCT6kk2TQdgqhV6ATcm+OfZN1C5yU1QPYmb001qEkxyv+j0U0ySYiy y3pNDcIRkKJtEqGj0Nr9fKhXKy4iTRoZxIljBpKmpQAUl/BU3Rg3crRFWdS8IAssbHOG LUT8sZSNzdV6ggrBiXZklt557CA+PLD7GZnCNilAlC5BsVWwG4yMO15v17q+hpql4yek eZ4A== X-Gm-Message-State: AOAM532T7WwciARFE0H3RDLKSgGH0d5Y/vnGjhO7l2Ongs6K30qCUJgq XZaDsIOEclCqAa/26COa2Y5/ZfKi/3Wppe/c X-Received: by 2002:a65:4083:: with SMTP id t3mr6562345pgp.150.1612403191984; Wed, 03 Feb 2021 17:46:31 -0800 (PST) Received: from localhost.localdomain (cpe-66-27-222-29.hawaii.res.rr.com. [66.27.222.29]) by smtp.gmail.com with ESMTPSA id q132sm3835462pfq.171.2021.02.03.17.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:46:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 44/93] tcg/tci: Split out tci_args_rr Date: Wed, 3 Feb 2021 15:44:20 -1000 Message-Id: <20210204014509.882821-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210204014509.882821-1-richard.henderson@linaro.org> References: <20210204014509.882821-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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 */