From patchwork Sun Jan 8 02:36:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 640371 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp1521089pvb; Sat, 7 Jan 2023 18:55:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuwOk1CMvGkT3joxw9TIHV3hLDYkm/Tpune7habpWLmv4J+YNQFPfkAv2jsc5a67ZXd9jmJ X-Received: by 2002:a0c:fa8e:0:b0:531:ba63:8410 with SMTP id o14-20020a0cfa8e000000b00531ba638410mr41467496qvn.46.1673146550357; Sat, 07 Jan 2023 18:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673146550; cv=none; d=google.com; s=arc-20160816; b=r1LHEkXoD4MLu3pMKkmKxiZp5D0muRjI5EeYxm5+ijEX6WmHUrQEa+A+XOsaATj+Bd W/G+UKp+Vt/GQJVHGdkf7QOMbj+7L4wHrMcEQfl3TSfDbxD/n7dURYpPNp5tLOlDzTps NWLZfJzN1X6LNVNP2ZyJJ/XKeCKaBEGPFvelFD9CdyPLVCngc4q9Zm/btQMNaV5VTZK+ YPbVqJvxqlT8buobl/QU/uXPU+8Fdsp65m58NJQjDzqfQLHBSQyasHNAq0nh6rxjw3aa p5wnfMT7SsuCUoiQmcl/PgcbxH55UBnhTq1F+Zi3IqFiikvkvbaNKERrwE5eYZuAlsZp lHGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=KwGYqVGD9ayC3AoH0H/svPpb9D46lwJjNWaf8TUEnLU=; b=vlJ62+7b8Ay5yPl9eviAsXjyB+RdjYm8/sdIQZZy40kfFEHqO4XRo4j1QP0oq40vir VTBqDZTtL3cWtcBq8aQVkDM3WgMr7Ao9MR/Xwtkh4gCAc0lH/Btxg0kMo8lQ5ypaMfQD bz8YCSiz77gCT7lvJ/YTn04MrhPDg9SIOrL6kGfxmfCk1yam6JYkpREE573yl4h0wJ3h ThyClLnSz+W042tpHCbS5B366w4Jjla8YnJCLj3oo/dTzIdU8bDSNEPDJFkq/cG2LVWK XeB86QckoZAU7fVydm3YH5jgMkucodp4iR+6FigyKznDIJIkL+I2LhN7nuIvd4fYh0js 0r1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wo92Lmrg; 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 t14-20020a05621421ae00b004bb95ea0e4fsi2722428qvc.350.2023.01.07.18.55.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jan 2023 18:55:50 -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=wo92Lmrg; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pELZD-0004o5-Qu; Sat, 07 Jan 2023 21:37:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pELZC-0004nW-Px for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:37:46 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pELYw-0004Y1-4i for qemu-devel@nongnu.org; Sat, 07 Jan 2023 21:37:46 -0500 Received: by mail-pj1-x1036.google.com with SMTP id o7-20020a17090a0a0700b00226c9b82c3aso5820227pjo.3 for ; Sat, 07 Jan 2023 18:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KwGYqVGD9ayC3AoH0H/svPpb9D46lwJjNWaf8TUEnLU=; b=wo92Lmrg8YD5vmSAR4Njag3d7RjIflVg0qFT/FuisA8HWhC99wUN6pl72nAHTHIXC1 m9qx2+ZH893MqiWmY+ZKAOMKIMOybMJ+CNP82Wn/2U7Ihku+KQJz9oddghm+k6QqLbY+ /T+hysSGmq6i9kOGePI8M25ZlcAb3W0eub1ZvUInIqI3bK8DMIOukN2Y2RUEWTjchQPr YPp/mdD+aqWKlC8zPhN1Xn7PbIGuuyXS3Q8tzsHSWvU836rbpVaBHHKMEpfeySPrJps2 kY/3EqK4L5ZHCyGHndh7yLAvasBEFFEYxYjbAs4XolIH+si8uitooS3Bh0G+wzyi4RCp 6tzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KwGYqVGD9ayC3AoH0H/svPpb9D46lwJjNWaf8TUEnLU=; b=HpU53WWec+v6iKuQbKUMhhjfRSvH6cYLzv2DYAgcuvdOJqcEuMZ8cpJpwXo7tA7+yu BVYd/BmCyaSabzAjCo3eIiEmv14uK96RtY0+3Ac+hDbbap+C34J4uYS0lQdgghBD3quZ Ia0SU/qVApe+BVt6jmVGlvSDpBcrOiGuxpN4JilW0ROyGHxmSzjolcHT/XPdmSg/xVTs TL99462no4QkUep49iK6vSXNYsAaQ7uc7MB6Qvvq5pFb2IHyQzwcEmh10PKucFY8Bd6W CiVbiu+bNhCqQ6K8vGkmryASTF8i1lbSwtpzB8sM7083V+c5hUaIb8PvSX8SUmMHDGTz F2iA== X-Gm-Message-State: AFqh2kpBk4jVpaeZ4kWfzWhCSRpZCqMDU3clPsAaLmQ19kcKrWs+TnI9 nAC8Bt+dLTjZp3oqbw3T/j20gDkzq5KSC67+ X-Received: by 2002:a17:902:7c08:b0:193:13fc:8840 with SMTP id x8-20020a1709027c0800b0019313fc8840mr6381304pll.21.1673145448869; Sat, 07 Jan 2023 18:37:28 -0800 (PST) Received: from stoup.. ([2602:47:d48c:8101:8a2d:2011:f402:6f82]) by smtp.gmail.com with ESMTPSA id o17-20020a170902d4d100b00189d4c666c8sm3394775plg.153.2023.01.07.18.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 18:37:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net Subject: [PATCH v4 07/36] tcg: Add TCG_CALL_RET_BY_VEC Date: Sat, 7 Jan 2023 18:36:50 -0800 Message-Id: <20230108023719.2466341-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230108023719.2466341-1-richard.henderson@linaro.org> References: <20230108023719.2466341-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This will be used by _WIN64 to return i128. Not yet used, because allocation is not yet enabled. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- tcg/tcg-internal.h | 1 + tcg/tcg.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/tcg/tcg-internal.h b/tcg/tcg-internal.h index 2ec1ea01df..33f1d8b411 100644 --- a/tcg/tcg-internal.h +++ b/tcg/tcg-internal.h @@ -37,6 +37,7 @@ typedef enum { TCG_CALL_RET_NORMAL, /* by registers */ TCG_CALL_RET_BY_REF, /* for i128, by reference */ + TCG_CALL_RET_BY_VEC, /* for i128, by vector register */ } TCGCallReturnKind; typedef enum { diff --git a/tcg/tcg.c b/tcg/tcg.c index 092cdaf422..c032606b21 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -731,6 +731,10 @@ static void init_call_layout(TCGHelperInfo *info) /* Query the last register now to trigger any assert early. */ tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1); break; + case TCG_CALL_RET_BY_VEC: + /* Query the single register now to trigger any assert early. */ + tcg_target_call_oarg_reg(TCG_CALL_RET_BY_VEC, 0); + break; case TCG_CALL_RET_BY_REF: /* * Allocate the first argument to the output. @@ -4576,6 +4580,21 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) } break; + case TCG_CALL_RET_BY_VEC: + { + TCGTemp *ts = arg_temp(op->args[0]); + + tcg_debug_assert(ts->base_type == TCG_TYPE_I128); + tcg_debug_assert(ts->temp_subindex == 0); + if (!ts->mem_allocated) { + temp_allocate_frame(s, ts); + } + tcg_out_st(s, TCG_TYPE_V128, + tcg_target_call_oarg_reg(TCG_CALL_RET_BY_VEC, 0), + ts->mem_base->reg, ts->mem_offset); + } + /* fall through to mark all parts in memory */ + case TCG_CALL_RET_BY_REF: /* The callee has performed a write through the reference. */ for (i = 0; i < nb_oargs; i++) {