From patchwork Thu Mar 11 14:39:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 397521 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp393693jai; Thu, 11 Mar 2021 07:07:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPFguY7XWZbBOhNN+ZO0p3/EShpnpxCdTKDy/5trlFdvXnW9svyu+SYmqxLH8IgbOifrQT X-Received: by 2002:a67:688e:: with SMTP id d136mr5236953vsc.58.1615475253347; Thu, 11 Mar 2021 07:07:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615475253; cv=none; d=google.com; s=arc-20160816; b=N/YmWPwbGnteCbwNpiVZxPZAf+tISu8niGnuZLHxrknUtZb+432OVkl7/8D0ZVrByr yDvSD2WW7Q3qdy/HvAjx9sq8P7kQ16gol15PAGixFKYzfgFDuMeYymGM/uy0PSQKFI6R KksDzOWKrB3ayAJOWWU4MWHaQvv9l9p/+VUEqYDpQjEahNI8jKMoeRRZGIpFXJgZqpY4 47ftkwerQdrUyCEKIwG94stvzlaD9RNh7gsLl3KCm+V9lbryCKDKTOnHjWcPl3ad3Q5P 3EH7hzWNzey0RyuIfAvwp3Hs4YM0vCLTXO2Jwc0+mwVSj4ZcIEg4l/IDaiOgNUh4kojx gtAQ== 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=q9HGwV3BEKPyCdGkQ/pTOTxj7GUtwRDMeNrm8U44fbT1etFt6+t20wD4MTntRqat8l ITNRjETe30hM5rJPyddAbddMwz1QKUIitYHPypJanTfNWIlAU6+EXYx+Dzzxul4MCJj1 azA5jxvehHmnoBFow8VR7DFoVzOk0CVCG4xEu4if6Fo1ozZ0EA8nkDAPkAo2kceAThy1 dr+2E5zdXYZLVWNToEGE1VYkApbBlaL/z+csL4iCukBY1NCYjxm2n+t5uLoc1Zgfl9AJ YdSO21vKVJy8M8Cesd/uLRUUVf1qZPs/OpDOsOMHFklUyc/ix4TAXxsayRqw+IQdWgWz 6V8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MbDoHyKy; 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 m19si532942vkm.89.2021.03.11.07.07.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Mar 2021 07:07:33 -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=MbDoHyKy; 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]:46806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKMuS-0000Nu-Mv for patch@linaro.org; Thu, 11 Mar 2021 10:07:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKMVQ-0004Al-R0 for qemu-devel@nongnu.org; Thu, 11 Mar 2021 09:41:40 -0500 Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:43738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKMVJ-0006t6-69 for qemu-devel@nongnu.org; Thu, 11 Mar 2021 09:41:40 -0500 Received: by mail-qv1-xf32.google.com with SMTP id cx5so2635934qvb.10 for ; Thu, 11 Mar 2021 06:41:28 -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=MbDoHyKywnkrny7gIeizhJcUFLPTU7M+NjrizR8mmwdnzPiQ9Qqe0Occr9uvtTfzX1 fE3OTHsfPWJNf/aurk1EGF1sJzj105EOZr0RGXamU/tLJNOh9blRGpX86YpIHT6HNuk/ EKi9ALDWIRBfidekbNV5V/SyVb8Qzv7qhYTgym7wM20mZqdxqxBXVxMljpC3b/gk/hso J4pjhLEApD9Ng96CW7KIfs9iM/ZAH5A6dnQMjpFooLrkt3kUSRXgSInUzoP+B6W3KGni ThUe0MLChLzPe6VWv6WYlkSUpt4oeMXt2E0MXkf4sO78qr4FK5uOobne0mxbhszYkBhj kMwg== 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=X8QrpUSO8/lYFfcDNVet+fU56VRsskN5GDE/caTchWB3w4G7ckmTAzdX64Lm/dijk1 h+nB4doifJQxWrROwhKDEykDFUN7w8YaHtMSVKdCs4tfzLFiJ6DQyOw7lLN+PEPr864+ eLi9diHH+PJFaSBzLK5u7IAIgWtx1yryBlaaPxO4JlchwGerpy0HRKd72azDMaZMsRtm 4DZAvAwPank8tzpxUnqXIl/oGyuGL37hkX3gnq9rcytPvkvWV7IhCpgnVOUdHc3T7/36 Kosd+efDuDM56TVJzRfZW8qhKkK+6agAMdXpy1LTEHPI7u2oZnYsvjPPPULLt/E++PPY WNKA== X-Gm-Message-State: AOAM530HjU5lQ2CiUO6EJspkOGzBGRFMLkYDivmd9YAtAOtw4YlwxjZF 1ggvdRDJsnBW+RHXdFdktRwNd1fa/rc4S6Dv X-Received: by 2002:a0c:a954:: with SMTP id z20mr7764107qva.29.1615473687796; Thu, 11 Mar 2021 06:41:27 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id g14sm1962421qkm.98.2021.03.11.06.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 06:41:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 42/57] tcg/tci: Split out tcg_out_op_r[iI] Date: Thu, 11 Mar 2021 08:39:43 -0600 Message-Id: <20210311143958.562625-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210311143958.562625-1-richard.henderson@linaro.org> References: <20210311143958.562625-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf32.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 Reviewed-by: Philippe Mathieu-Daudé 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)