From patchwork Mon Feb 8 02:37:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 378479 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4328756jah; Sun, 7 Feb 2021 19:22:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWC/RO/4WZNqtidf9MyEClG+odlf0mYZFZgnnCuDkqUrZkag6/Rn16C20a+JRQt2ysXOmT X-Received: by 2002:a25:dc8:: with SMTP id 191mr9549151ybn.246.1612754530067; Sun, 07 Feb 2021 19:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612754530; cv=none; d=google.com; s=arc-20160816; b=YjVOnfPhISpzF5XyPjJYtRMEE1n8RySNPe9WfqlK7yLdoGZtYZIyCUISW+dVD93Ju5 LIiNpY1ufYVWCIen3U/2CjxzCuiA0Hl2OtNd9vyIjdG8Vi3x40KzAcmeqWW+sLZjc2Yf r1NzKnmLiB9aU7bnZotLyr3Xv3XnBDEjML050/HP7NGAsn1qjlPwwPV4cbuMxdYxqPKy uC20lc6v87ladY7M31gfnu5AFKD3FDaVlpp9wWvkzu/35r2up8PlLsjcoLBeuQj3PXEQ wwhMQFANMfT74YWZuLD5fe+UtS6WOv7PvZLq5LgdD72x2QRqvIuo1VflP6kPt5CB6aqn +hcg== 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=GajimJ2RK3+N/jjA/mNw5VWp6xPFUOWduiSLO+EUsZ+tD+LmsUyUMwOhT3nDQrwR44 li0JuwWLKC16yCQk88UrCsHZpfNuNCpFDndNZBZGTPkx1gE1FycfKP60tUg/LAfR4brc V2K8Q+hRHCdG0iKC7K5K/JfnydzlsWumDWswSNW+QnQGpQKiCoyri5S1pQNP9CtHld3G 36kT4Dz4MdyUH7X4WWmhoWYh7cu/+cx/O7H4AWnREVOOWilSZW73YtcPwFF9+ekvC4G8 F6hbJxKGAysqQxg7P2U8xHBspmFr/VXSPFLWN1lqJiaJ5Qau7i2ooSriJvKfUv3KQBxV pm2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AOplEWi9; 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 v7si16721116ybk.294.2021.02.07.19.22.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Feb 2021 19:22:10 -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=AOplEWi9; 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]:59146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8x7p-0001Mz-Ga for patch@linaro.org; Sun, 07 Feb 2021 22:22:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8wSa-0002kx-QI for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:39:32 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:45194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8wSZ-0006AN-0W for qemu-devel@nongnu.org; Sun, 07 Feb 2021 21:39:32 -0500 Received: by mail-pg1-x532.google.com with SMTP id o21so7854032pgn.12 for ; Sun, 07 Feb 2021 18:39:30 -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=AOplEWi9iVKeLJiKb5R1Zxw9IuUZ18qYjbAv6LZ6F+drllUpyFCArhzW09N0GR1Mvc IV7/lYLoUU7hQbn8TgNwv4NmuLVDPTFLFlA9VXiCaO7GwrwuXdcTDV6M0b/RL8EnvVar TbcWen8nqdRFpvOKnFAqygD4nRgAAI7aqWjD8r4NwcZdGRiR28VUbN7jg38YXlrv+Ekw fZ/DXfMfGv5jogfHuToqeTToeD8WMYUasmA4cB/AGuvNHtTnQDU/GUYycKvEJNyg01YK SeqjMiEDvD8mBOfR0JaGcU9NlknX8C/84SWaBSrYlsVtUh/saVye98M6CA/raJ72HhkS /9OA== 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=L+PmWJwN/MM+aupK6cXeHsn666lrRImfC4pYjuwSGcs/4DgVaEBsBOCug4P1Pw7vl7 PehxrlZHl+q+9GWtNT9E3hjM5QSvaKR5UTtk2XIyOtlOhqgFC5WitGTftrOiqIsl2mv2 RbPCwITyu6nuUy91SGfcaNtWDHYsqlsn8hJOksMIkrHgS7HHaBNpoum8O25owIaV4Gc2 K1tbslSgNR/Hysb8J2sZ9U6vFt5rVwbLKEMKlITrYrQtNxEb99zBeBtJp6gpOvoj7Zpa TGBwe2GTEr798aeqrRkgHwCG2nt6CGph2lZGiwpGK6K9MANsOXAVmaI0QHyUxgNJMQZ7 AqmQ== X-Gm-Message-State: AOAM5317nNCXfHPtgLho3Tb72ufbXo6Ga7zNXqOgyBJFXxboXj8VcvB6 rcOzWyzbBoA9n4yhH2jc1MHPz9QjM0EnYg== X-Received: by 2002:aa7:8497:0:b029:1bf:47c6:523a with SMTP id u23-20020aa784970000b02901bf47c6523amr15913113pfn.0.1612751969468; Sun, 07 Feb 2021 18:39:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Feb 2021 18:39:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 54/70] tcg/tci: Split out tcg_out_op_{rrm,rrrm,rrrrm} Date: Sun, 7 Feb 2021 18:37:36 -0800 Message-Id: <20210208023752.270606-55-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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: