From patchwork Wed Feb 17 20:20:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 383900 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3136611jao; Wed, 17 Feb 2021 13:09:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz2WMumJjsqgxirMPZrU+KT3AnpJ6zN5UHtp67G06OYjvQGk/h7OTihsOHhkTS3gmkBv0o X-Received: by 2002:a25:860a:: with SMTP id y10mr1999415ybk.254.1613596151655; Wed, 17 Feb 2021 13:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613596151; cv=none; d=google.com; s=arc-20160816; b=jBt8aL6bR3JNW++QKExgmGlYPjxbI9qbMm8hDi5BLelP8xnar0mTLKaRddEk5O5/pd 7c11PG62wJg0N+ZaBB3NoFlMbzhAwyNa0yjJZcCTNdCDA1nzClLg8kZIk1gTNpkLjb35 zuAWp74FjHyVNuwkWADqRv3AUE9lxJR3nyZLEMuYiz239Ch8yu8z1k1B0IvZz615OEwh TDuWYs9lRkHm6bmugnXqLfb6e9Lu2jDF9HqbLxyHB9W/rJfZEZVcvu+U6tE4Puet3WI0 Qix2Lz4AXxNOTmSNVewt2yyiWa91yJ1371FO1+wAARCLsXxSo59GWx7aXI4bUABCy0R5 HruQ== 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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=qYODYI1UoCKPi5PJwsJ4p/Dwts01mV+ceTaLBE4d4zvuaJBemGrHVY4cu83d0HuxTi ZkDCjWqa1IhaThVvYov/QItJpUqVrx/8Xs+2ZF15jrGkgv1+Ydev1/uz9c9HLADmEr9M sS5PXEns2igz/ndNLVvb2qcd+fpG0s0XLsYrk65w15fZ/ITUNWl+YZwY7BqyDCiJXpUH hnnPIH67G9EcATzdCo7H5SVWOMagllQoOO7SsrltbLSm4NNKmxHe/foGiIt1v443KW6c GVi5tNgMbr+9FYpLkcaLHJqMK9rA4wed4NgvUXfQR3Twn7Iu8tkUOfFa7QKIWP0nKjnl 0TaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ER/Nplcn"; 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=fail (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 p129si3248007ybc.227.2021.02.17.13.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Feb 2021 13:09:11 -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=fail header.i=@linaro.org header.s=google header.b="ER/Nplcn"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCU4J-0004AS-Ep for patch@linaro.org; Wed, 17 Feb 2021 16:09:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCTMn-0001nY-N5 for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:24:09 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:44506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCTMm-0007id-3J for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:24:09 -0500 Received: by mail-pl1-x631.google.com with SMTP id a24so8021820plm.11 for ; Wed, 17 Feb 2021 12:24:07 -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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=ER/NplcnuZ/Yrth49dhkpkbWSVRyZZF0DnQg5xki9M77awBu1/OeVjdiPg67QwZdBl eI9HYY3PQDLmIUSKVl3FJHxre6UWWaYxQnvFARTN/J0rht87OPC64mUbzYJIMyYfOVHn UzfTPDEWA5nucUT7OHdqKpBs1acV1PVriNt9BZu4TZkx/22uaqJHmDnpv6SYsQiKf6q2 FXpQPJ9VPmpa6cNXtePQsu6v4H9GCAbVwmN24nTOiTmgYmv2hczECCImBQBdCZRWvc7K 3ytmZGSQrHk4sHdJ/vZHUdQBzmaucUZX0dtE3mgGV3q94bHnJAXdhJuemZXoKjEIRGSD LEhg== 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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=aTnz2e2++b8Y+g7dCx8yVoD15LMBhy6XTO9HzR+Pq7X+SA1W/ejFGJWWE8ktZU05G0 QpJpL3R7uuvMya1VO6/nkvmaXw85MZQddiAE3f5YoMZDha4fhciN1EntBOMhXPRaBoXC JTHSB7M2H8yKeQFWhDWpKMKlmQCyI4+730K4QXGnDVaovdW9s4w5tls+AzD/v/TXbWkQ mseoCJ522RNXKHXBZWhZMHXEHnTw+5RsH/aq28ehBPflqhFoXWDoOZUILxbZPRZxrrPA 3+uB8vOJOso0o9DRxTIMvNfc/nxwhs8v2J7Axm2CnpNnvT74/NhSZVJ2P/nKP+13mtOe 8XBQ== X-Gm-Message-State: AOAM533iZqtlQmyDUPf6Og3UByxyiXcwSSvovcffjf9uT/kWz1l7n/08 /hFqimuu5j4wmNwAo8vKVTZTU/f7s+BEgw== X-Received: by 2002:a17:90a:d3cc:: with SMTP id d12mr566848pjw.202.1613593446909; Wed, 17 Feb 2021 12:24:06 -0800 (PST) Received: from localhost.localdomain (047-051-160-125.biz.spectrum.com. [47.51.160.125]) by smtp.gmail.com with ESMTPSA id v126sm3232038pfv.163.2021.02.17.12.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 12:24:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 57/71] tcg/tci: Split out tcg_out_op_r[iI] Date: Wed, 17 Feb 2021 12:20:22 -0800 Message-Id: <20210217202036.1724901-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210217202036.1724901-1-richard.henderson@linaro.org> References: <20210217202036.1724901-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 50 ++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index e4a5872b2a..c2d2bd24d7 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -324,6 +324,31 @@ static void tcg_out_op_np(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_ri(TCGContext *s, TCGOpcode op, TCGReg r0, int32_t i1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out32(s, i1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + +#if TCG_TARGET_REG_BITS == 64 +static void tcg_out_op_rI(TCGContext *s, TCGOpcode op, + TCGReg r0, uint64_t i1) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out64(s, i1); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} +#endif + static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) { uint8_t *old_code_ptr = s->code_ptr; @@ -550,25 +575,20 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) } static void tcg_out_movi(TCGContext *s, TCGType type, - TCGReg t0, tcg_target_long arg) + TCGReg ret, tcg_target_long arg) { - uint8_t *old_code_ptr = s->code_ptr; - uint32_t arg32 = arg; - if (type == TCG_TYPE_I32 || arg == arg32) { - tcg_out_op_t(s, INDEX_op_tci_movi_i32); - tcg_out_r(s, t0); - tcg_out32(s, arg32); - } else { - tcg_debug_assert(type == TCG_TYPE_I64); + switch (type) { + case TCG_TYPE_I32: + tcg_out_op_ri(s, INDEX_op_tci_movi_i32, ret, arg); + break; #if TCG_TARGET_REG_BITS == 64 - tcg_out_op_t(s, INDEX_op_tci_movi_i64); - tcg_out_r(s, t0); - tcg_out64(s, arg); -#else - TODO(); + case TCG_TYPE_I64: + tcg_out_op_rI(s, INDEX_op_tci_movi_i64, ret, arg); + break; #endif + default: + g_assert_not_reached(); } - old_code_ptr[1] = s->code_ptr - old_code_ptr; } static void tcg_out_call(TCGContext *s, const tcg_insn_unit *arg)