From patchwork Thu Feb 4 01:44:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 376218 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp865691jah; Wed, 3 Feb 2021 18:48:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5tdq2DTTAIoX2+M+0Irsu/1pzFFSaQtZE+GQJAnpmn25lkZn4a2oszgxyrNL7z4YlE1mH X-Received: by 2002:a25:ce51:: with SMTP id x78mr8974540ybe.198.1612406922245; Wed, 03 Feb 2021 18:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612406922; cv=none; d=google.com; s=arc-20160816; b=dIbDNqxoXB0tVRIk+e1+0YvcYdd+v69VEs4DUBE6vgmGpp9UijdoT8llnjPmkc2RYE A2HjD9l5BXH1gCXXYYMQ/Ktvn7Zg6qTgS0PVH0hcV6vYAIYfRjzAPRFckdRUw1HMipTj P/3nvb16QrHEC39kHU8oceBBPVcox+18VvoiQ/RBGDc55TCkCA3Ky9tIeEMOQGIH4jWX GTs8X6s4A2AhR6aA0OLMTeWnF2tox0hUaeKZo4jOa4/vL1sUo2Mnb3oVq8XJePYtAx2O iXq1VX9jmM0RzBGc2GAhnxwQmKZ42CQV2s1hOIPYzqxIyQWuHGBEiR9d3VgNUKCf+6Ht TeBA== 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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=agHnffp+0moOBzV0CGufk2KhMRt4wrsgBtLUZc2KN2+Ku06/YfbIyZXHentcoZHCBZ 8kwWYSXdMXYzWErCvT9+M7sY50Xt95neZ1rZ7uJqCmoVeekgzJvzzRqgQt3fMF9Issth wNM8VLMXkPoUflCSd0QqNGuy1gr2zoVTa3WYNwt604EQDtokMdpbt/tASpkTzs6ksPCs c85oaQHvLjbt5+VVfpl8KpnPIP5w2kZ/mjuWMRHlZnvdW+uGprNXRdM0rE0xB3+avusE lt2tzjWimcEInIph7mFeJZx9Ku+11eNSb0zAzvURjQGESAU9ANH9juWalZk1769rUd59 nYQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iUn2gDuy; 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 j13si4266642ybp.459.2021.02.03.18.48.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Feb 2021 18:48:42 -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=iUn2gDuy; 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]:35220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7UhF-0003vk-JZ for patch@linaro.org; Wed, 03 Feb 2021 21:48:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7Tk6-0006Sp-MI for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:34 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:40781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7Tk1-0004F3-Hh for qemu-devel@nongnu.org; Wed, 03 Feb 2021 20:47:34 -0500 Received: by mail-pf1-x42f.google.com with SMTP id i63so1070415pfg.7 for ; Wed, 03 Feb 2021 17:47: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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=iUn2gDuytfVBb9/COd2Ua1DDJO0yMDr97GUDsUrBuRy88g2FtpAqAI9+cNNnvHJgcU /J9TojRnRRgF53QHPmJeSTDA/CVEtP+Vljh1L7cggNDUZ241jznN7Z3m+NPU1tUcBGdk LPJTMV9qbb74bpp4Zjr3GLQ6pFCYvtpQ1y7qv5NvrWJ/9IAL6nRabv3WCR6sMOTC4Ncx Rg/2chIjDUQkhkbI+FJaDv2I5GXJm3qmRYtG8oDn+a8OtUnbqQ1hOlm5XJ9j3M+opm51 jvYKxNR606EVTHk81oBMFfN3jLz5BSk6s4sxni+N+d/zd2zmmdCm7Tm6mYjZ4V0RUAug weVA== 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=UtDE8Pm65Grc/U22TwT0AwuyG4b+N8yR6xVz8cz41eM=; b=F7oHWLVFvBwBcegvd3T/zVV9J5tqA9Ie8dPu2nxtGLl95OaIn8eMmmAZep2HDfo9Tt KYHYXF0RR55ucjicW+BkJzTcdUhhzhAiMYH+7SuEiza0kiT9mK//Ex4tL/ZIzbDf7uMG 2gxuO88TdTk+/IXEsbnTSv41K5n4xEWys5WwGfwYx6KYjjznT05hzHNZ0ZJn26iyOsfp 8A/G7TwMBAuSMH4fo52lyo8/6c7ras2HlBSN008khTNYJjqrrzI0kJvRpB5PuDxZSg07 y4532JHMG4fSj0E9tlKtfaFX7vfEGr0IjoSkNR87T6VtltzdV0RPhHpd7Zp2uDjUIG+N vnUg== X-Gm-Message-State: AOAM533kzy4lW/uQawmOZJBWB18WELOZedws9if/NIKsuptZ1URiuTMY 8JJ54YrImG2zuMfHwTi3wxUALZ/bpv7wzVDt X-Received: by 2002:a62:ddcf:0:b029:1b7:baca:6c71 with SMTP id w198-20020a62ddcf0000b02901b7baca6c71mr5865362pff.43.1612403246993; Wed, 03 Feb 2021 17:47:26 -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.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:47:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 79/93] tcg/tci: Split out tcg_out_op_{rrm,rrrm,rrrrm} Date: Wed, 3 Feb 2021 15:44:55 -1000 Message-Id: <20210204014509.882821-80-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 | 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 fb4aacaca3..f93772f01f 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -314,6 +314,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) { @@ -369,6 +382,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) { @@ -384,6 +411,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: