From patchwork Wed Mar 17 15:34:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 403199 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp605915jai; Wed, 17 Mar 2021 08:58:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkMoL+ZmYUaSFHtY+rfmego9iJYewvHk4EOfUG6cPJeLdruDMkeDJEZnfYa6p7npdWn0n0 X-Received: by 2002:a05:6e02:19c6:: with SMTP id r6mr3013284ill.174.1615996690017; Wed, 17 Mar 2021 08:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615996690; cv=none; d=google.com; s=arc-20160816; b=iyrlAPWIBdwZIqko7KcnKbhAH9fvV43kQ4/Dh5zPtzpbrTCgbdE3/w4vyLPDkhiA3K Vs8cJweWo22iVazc6teOpNmy41Zz9pOo/YIEJECKw5jqLSqaYor60C/Vlul3rZFCT1xS TWzhm5NEoSWLzPtfkplX96htRVKhV7SaNtjbG8k9UuytCxPWFFvjnTJoUw8c9pgI1Sd+ FJ5/KGcB2HQfCAdNkPRnz/K9pQ3REeHS/SlP4vpOQArH0tmSB4otlutKlAI6Q+FEJZkX fWll9oBLewKRD4JHCCQXG2MKfsrYr0kUvIL0Vx7px2mFwZAB7ahGFOlrdr+oDFCfB8Tf Ja2g== 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=kmnDEWcNjBI0CV2v+4la8ocEzwYbaD/h2AKvp5PoRaQ=; b=LnKGz6hQDEv0+QjvQUdjpj+QedlY+hKrxSqbpS5qCeOIbBg2nE0oVEnYdKbtYOAEoU Kt5EzHBIawDnltCmMXMD83dlYsZkJJWKVHCKhK8rZx7m/g81e+qi4lyr7RjuB4VLAnxS aNtQ38T1Bw6lIgEDBiAg3mvLmUhWJrfJZ5enHsI6uux4bEwqegWfFs8tlN/cNZbmiNGe Hdjf9mHt4piKWFpmAp3Ddvh9Y8lF9B/z26wVDtsDepJ4C03gyPq7GRNgAv+3ZxbcEw9W zmN8dKdsUGXy5t8i/3ETWf0fvPHxTUMSM7dSAjskKChr5LzUb70TP/gMmqOiS4Ftiauf SC+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kicFyuMa; 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 g25si16399996ioc.83.2021.03.17.08.58.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 08:58:10 -0700 (PDT) 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=kicFyuMa; 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]:35124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMYYj-0005TX-Di for patch@linaro.org; Wed, 17 Mar 2021 11:58:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMYCq-0005N6-OC for qemu-devel@nongnu.org; Wed, 17 Mar 2021 11:35:33 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:41851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMYCg-0007JC-UO for qemu-devel@nongnu.org; Wed, 17 Mar 2021 11:35:31 -0400 Received: by mail-oi1-x235.google.com with SMTP id y131so39324039oia.8 for ; Wed, 17 Mar 2021 08:35:21 -0700 (PDT) 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=kmnDEWcNjBI0CV2v+4la8ocEzwYbaD/h2AKvp5PoRaQ=; b=kicFyuMaTDrZfHZIcDo6QPxj1BaobnhlzHUPUFK9vTnmC8TdiCtK7euaXMLsEtlpTm lpW52QCMscu4d8nVfd5MNgZX7C85dc8iyq38zSISxvikQQZN5dWvpgXuuD3k3wN/3rZZ 4mwl3QPaQ0Bosi5r68a+f45DTj2GdnPXI9OszR2IsBItV7OgO/+zVCwRaEK2diZ8KAMH p5xVjwZtwLQByPUeNgjjr0+e2UCBbaAUSW4d2VbX4nY5vepuXGxAnzVzJeXL1/Myhxy9 0E4opSW7uwUfKUz5l518y4tD6EDxM3eno9RtSRZpPBC0PRKvXPijuTGWrClfagC8sQmJ VqCg== 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=kmnDEWcNjBI0CV2v+4la8ocEzwYbaD/h2AKvp5PoRaQ=; b=JxnD/swvD2FjozL6izROMUsQ1dlpnMmc5SC38vtx5iGKlFkCaCsQKSF/9OnNOXMz6Y NQ2ZKEy1WICCR1P/3JvUzN9Bz1/Lw4LBMqZM+UKu5YOYVB0OCUy/VlOip3DJgVScDyBB H+3ROoK9vkTHWAloqTiTGNJJbMOKvEERoK2yLg0zQkG3XBiw6tdN3ytAx3067CSel1mp ZdarbtL/sf6NCAI9tEJ+OVD9Ze1j0NwHIqFzDNMgjQjbtyA6GPLZUSkPDZLwaA972sGt K0zl3Jr1okPx4kO9DGVY0Ha6vd4uGalKpr0yYwtVJT6llk6rPxtDuGbT4RbPEqTL62Nb 1R0Q== X-Gm-Message-State: AOAM531rJ4j5gBfz5pc6ejZa6MVvFkeTinz83m56loTJfVEavM5sHqX+ DS2LnQVfT9FRJr5Z8sJfeqMBNXVTZYWCy4JI X-Received: by 2002:a05:6808:2d5:: with SMTP id a21mr3270143oid.88.1615995321315; Wed, 17 Mar 2021 08:35:21 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id i11sm8271154otp.76.2021.03.17.08.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 08:35:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 35/38] tcg/tci: Split out tcg_out_op_{rrm,rrrm,rrrrm} Date: Wed, 17 Mar 2021 09:34:41 -0600 Message-Id: <20210317153444.310566-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210317153444.310566-1-richard.henderson@linaro.org> References: <20210317153444.310566-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.c.inc | 70 ++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 17 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index 86b59179bb..2aa0997ae9 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -328,6 +328,19 @@ static void tcg_out_op_rr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1) old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrm(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGArg m2) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out32(s, m2); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2) { @@ -383,6 +396,20 @@ static void tcg_out_op_rrrc(TCGContext *s, TCGOpcode op, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrm(TCGContext *s, TCGOpcode op, + TCGReg r0, TCGReg r1, TCGReg r2, TCGArg m3) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out32(s, m3); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, uint8_t b3, uint8_t b4) { @@ -398,6 +425,21 @@ static void tcg_out_op_rrrbb(TCGContext *s, TCGOpcode op, TCGReg r0, old_code_ptr[1] = s->code_ptr - old_code_ptr; } +static void tcg_out_op_rrrrm(TCGContext *s, TCGOpcode op, TCGReg r0, + TCGReg r1, TCGReg r2, TCGReg r3, TCGArg m4) +{ + uint8_t *old_code_ptr = s->code_ptr; + + tcg_out_op_t(s, op); + tcg_out_r(s, r0); + tcg_out_r(s, r1); + tcg_out_r(s, r2); + tcg_out_r(s, r3); + tcg_out32(s, m4); + + old_code_ptr[1] = s->code_ptr - old_code_ptr; +} + #if TCG_TARGET_REG_BITS == 32 static void tcg_out_op_rrrr(TCGContext *s, TCGOpcode op, TCGReg r0, TCGReg r1, TCGReg r2, TCGReg r3) @@ -663,29 +705,23 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_qemu_ld_i32: case INDEX_op_qemu_st_i32: - tcg_out_op_t(s, opc); - tcg_out_r(s, *args++); - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); + if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); + } else { + tcg_out_op_rrrm(s, opc, args[0], args[1], args[2], args[3]); } - tcg_out32(s, *args++); - old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_qemu_ld_i64: case INDEX_op_qemu_st_i64: - tcg_out_op_t(s, opc); - tcg_out_r(s, *args++); - if (TCG_TARGET_REG_BITS == 32) { - tcg_out_r(s, *args++); + if (TCG_TARGET_REG_BITS == 64) { + tcg_out_op_rrm(s, opc, args[0], args[1], args[2]); + } else if (TARGET_LONG_BITS <= TCG_TARGET_REG_BITS) { + tcg_out_op_rrrm(s, opc, args[0], args[1], args[2], args[3]); + } else { + tcg_out_op_rrrrm(s, opc, args[0], args[1], + args[2], args[3], args[4]); } - tcg_out_r(s, *args++); - if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) { - tcg_out_r(s, *args++); - } - tcg_out32(s, *args++); - old_code_ptr[1] = s->code_ptr - old_code_ptr; break; case INDEX_op_mb: