From patchwork Thu Jan 26 04:37:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 647073 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp59029pvb; Wed, 25 Jan 2023 20:43:36 -0800 (PST) X-Google-Smtp-Source: AK7set/TuUKQWknE6Ogw9rjbP4nNkRD3bfmNMnEQUZo14BdE2M19y/F5I1yVkhB8GK1Z/+66JRTm X-Received: by 2002:ad4:4d91:0:b0:537:7566:5098 with SMTP id cv17-20020ad44d91000000b0053775665098mr6960279qvb.15.1674708216286; Wed, 25 Jan 2023 20:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674708216; cv=none; d=google.com; s=arc-20160816; b=gPr+m6IL8FO40USCf5gUnHOqaxDU6hxxz9IPIBBsqH3B79tGN7h/2sfjbADEssGWCV l8ThkgkfT0tDQFqqmsp8oxNp5Zk+DTAM9cxCwrIk/zM0i8+J3RdVOwzxQZVO3Em4tqbL DyYJ/a0lKqbEV8xBB5lMI0/amzpgSSaVrF4F13DiGqw53qbowyu2KNqVCe1S+6Es5+a1 iMUD43GKbX9lvP90LMC750dM6/DViR3ArtPjXk3I+k/PVrH55240Qs+Q65awHe3kBOZJ GuxRKLEPHu0FEN0A+TLC2XtLezmIIvjVpeomiTy21kVWGMq0Uwtc2FjDT11ZC90+h3lh U4QA== 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=IayjR5zNq60WEhTjWTVhpDuC8xofWVLS8FB3KMbySkk=; b=imQOeBy5vuUqJ6S3iL9bI45Z53m598LGBQetsLbMS4+Qb7gryzi9CzX9S0PbfHCDHg vKSLk6LvZkFuwPLfTr4gPd2PoKQFJxYNxhC02tHnBqeDYpxx4tzUc6akM4uhQB104N/l WcMH/GTmR+jrKf/b4d8Bm6PEpStlzA1/NIK19CexkkgVNIW3zYo0uCUkON1g2Ouq+QuV owy2PGoORLpU/WT0lxtTb48dbvVuXPSuUCW3Wo/xLza/ZR9MR/qE/FNZQ05BU9QrvJGK sS4YVgLeV+Wsbmqysef2+5XLanxXkOq9s20AUe0UuG49BbnyCBddUep7/ToYjoF6WjgN EEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E2aF/CV7"; 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 w3-20020a0cff03000000b00537661ff2ebsi215704qvt.320.2023.01.25.20.43.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Jan 2023 20:43:36 -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="E2aF/CV7"; 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 1pKu2A-00009a-5w; Wed, 25 Jan 2023 23:38:46 -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 1pKu26-00007M-HR for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:38:42 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKu24-0004P7-Ru for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:38:42 -0500 Received: by mail-pj1-x102b.google.com with SMTP id o13so538805pjg.2 for ; Wed, 25 Jan 2023 20:38:39 -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=IayjR5zNq60WEhTjWTVhpDuC8xofWVLS8FB3KMbySkk=; b=E2aF/CV7GEEdbqctV19XbNXYt9hI1iB3wvMIN4VT7w9rbkLvrFVVooBOq9PBPXXYWF RYzBGuidaFITG335vizaLK7o8E+r6KHAvU1l0Cee5TJ6uI1epr9eRNyXrrHrDeCCdJLd sAYeKZy2COuMQFq391VTIGDIG27+ROCqx0Mhsa7RYuoIyN7k3wmvuJaDtF6EoWh8vBMn TRgWBLSmbAZSnbk5jQxR/8s5R6vmorNjO4clVLa1PjU0fLWieFnslSpBLoFzVG5MmS8L pRC/tWPGcBRqkLbIaQjJi+//bUgZGhhRArpGJSDHskoRFR+bmfHt0PElpweWKwqMDbV3 gw8g== 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=IayjR5zNq60WEhTjWTVhpDuC8xofWVLS8FB3KMbySkk=; b=pI0fYtgdXKGCnzp+Yw1wwKCF1fTszsTGAH+3r78T+kYYvUoE1juuJ+T7+MR7A2lUYB 2CbK/Hf10QEv73HaJ2ca4zbUzCMukb4J/Qdrn2nJc4m0QWrH/7HkraZe6VvIZijq+0SA Nua6ogiBMBmuW+GhlQzVanrVv6+aVQye4AHpiRp8W7eLuFN4eO/Mu1AFxV8X9res7Wb+ 1MVHbGqy8wzO2FqCSU3JM+Gk6PySuZrUnjaMCw0xVdK2sOJo/yNJhiescPQxLZGViTSr oJ+SwOD4pmI62H2I9wP9YTlSQQAhNHtPlsOvDxosj7NgDtl9BUDg3wjtZmG5LTgeqbkz oirA== X-Gm-Message-State: AFqh2krohY5XpdZnN2Mjou0yp3bLx5+ecgEzuOLjO3FHOTQgRyB/ycfL oZUEfQ0KkcVqU3/iWRn86w6Cb2Bg/brkI061vu8= X-Received: by 2002:a17:90b:1112:b0:21a:1f5f:e798 with SMTP id gi18-20020a17090b111200b0021a1f5fe798mr36008904pjb.48.1674707918652; Wed, 25 Jan 2023 20:38:38 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id s62-20020a17090a69c400b00228e56d375asm233376pjj.33.2023.01.25.20.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 20:38:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH v5 07/36] tcg: Add TCG_CALL_RET_BY_VEC Date: Wed, 25 Jan 2023 18:37:55 -1000 Message-Id: <20230126043824.54819-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230126043824.54819-1-richard.henderson@linaro.org> References: <20230126043824.54819-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- 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 72ac76926a..084e3c3a54 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -752,6 +752,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. @@ -4598,6 +4602,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++) {