From patchwork Mon Feb 8 02:37:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 378468 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4325444jah; Sun, 7 Feb 2021 19:15:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7pKwIws2+9Z5RUVapiNqRTDtbnWEJ5EDAJKggzPkZR8Dqdyl2jb2R56dAvxflyXh8/3In X-Received: by 2002:a25:3450:: with SMTP id b77mr21828393yba.352.1612754145625; Sun, 07 Feb 2021 19:15:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612754145; cv=none; d=google.com; s=arc-20160816; b=AudTF04egzAYCuXKFM56xMRdUXse67pUseDqGI2mzC4Eu2EcE8wcWmNiHkOCl1VeZF WXVsFHHZpWhl2RrhrTFGR8Cjc1CAlZI2XA8azbrWwC+CmHSK7VQaKZetO+YIVn0GTonZ uBZu+8/sOApzbejdqn5ak2PQfPnXaoGgogJLx6vnpF7BwjVlBznFbAiITKxLw5UIyZzq AQ5mXTm+ZMn4tHUUZzszC+ztfRAITDNqJr4CfieJMqPzcK/o/MzKRSPdD3/lagpDP57+ XhKFftBTRU4ZU7C0tIS8xP7OD7mKPOqTOFLUORhDB5i4Vve/0kx9dhWZE3XiLnM0F7GI 7JPA== 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=OSXXm/Tb/yxqH47mTYzKOVgVd74Lz4NkN71dinDGlUaaM+9u5Jmra9GPjlevJZ3eiI JT/oaputwog609aH7As1Gwr0Zqyw0dcVM1RcRGPopE550Vqq7JRM3DBTXHYVFQvrXyf2 ZUebEU5rirPnZrsAXGxnJs0ztMLIXtYVdakjW1/jeQD2m9eB5/65h31dLJ+ZQ+zM3l6F GLVFEx7BXAyQByCmi0YntK9g+UNKLpXKGKBs+r+8kQzOHj4LcwqRfX4SnbRbGQ3Ih/lA yCLy3sc9CTN3M5B39S09ApPuF1KZ5EGYw3d9fP5+WoBIzbw7Is3sZ8A3+UvUYXm1fP/2 P+AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aI1MZUad; 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 l3si7404244ybt.150.2021.02.07.19.15.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 19:15:45 -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=aI1MZUad; 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]:34594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8x1c-00083r-HP for patch@linaro.org; Sun, 07 Feb 2021 22:15:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8wSd-0002q7-KI for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:39:35 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:39200) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8wSb-0006Bd-WC for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:39:35 -0500 Received: by mail-pl1-x631.google.com with SMTP id k22so2650280pll.6 for ; Sun, 07 Feb 2021 18:39: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=nbzdCRnUzVvHAlHdm0W/U/kL5Ps02KKsV67u0VtR3Rc=; b=aI1MZUadjl7beKap6OTg2bPVbWJTAAde2E9trzg6HvoDaW8G5LL++TMpyceLhPhnwR 1yVcrUnUrdZkDzTTSse2XTzarjfyO4qS22jzCHLWMQcd/zMJW8I1GmCA1XXzitIheczZ 9Gmk03jUFnXjGQXoQ53TSPD8z+ze6UkY+SI0+MU9N5azW/X4lt6/sAqVHHhPONyPszKn P4g677zeUMkbBhHOX09lsZnSQjbEAe10OL7kefFSVrO01Qbz+IHocKNaakUQdlnv9Nyc FHSGZfL5bS7WiAv5lzWSVDxLIAp8HZs+jYhRl34NNtelJBAofObQXSqBxhV6f/js4Evt tRtQ== 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=pQwuU485uK02V3bfJPnC2LF8uxBJwXgnLqBksE13zZITRoyk98d+Mcf8zaNopCRl8+ cXAObyzVhi13lfFTbG9bwq8bz+7UlnuEOATwcUZO6x3fCyP8uRcMSQx7hTcG9Y52EJT4 tby86bwA76n309tlG79udEevoHOJE2lfYM4Dilp+wzFmep9rRtjRGrvVLRc7SHr0vR8x 379pG5EQUmuLIdCximLBHgmEj4mbjHaYGu/e6cpycRg8QoQv6qzTaUXuB7PGj8rSEJ7b TA2C9hBxVFI+zvXW48n0QotE4OVs00l3C4OFuox9p3ayRGAhJZ1x99/OhumKVs/y0zmQ 26xg== X-Gm-Message-State: AOAM532E2lMbG4wJ0JQZycFmWYn6ZHCJkDlK6I/3pOGMeirwEhyIRFt4 TER3MVhAY5FfVwpZAP/Ss6mDLp4I1M3Yjg== X-Received: by 2002:a17:90a:db12:: with SMTP id g18mr15056912pjv.72.1612751972854; Sun, 07 Feb 2021 18:39:32 -0800 (PST) Received: from localhost.localdomain (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id 74sm650954pfw.53.2021.02.07.18.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:39:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 57/70] tcg/tci: Split out tcg_out_op_r[iI] Date: Sun, 7 Feb 2021 18:37:39 -0800 Message-Id: <20210208023752.270606-58-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::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 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)