From patchwork Thu Jan 26 04:37: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: 647062 Delivered-To: patch@linaro.org Received: by 2002:a17:522:b9de:b0:4b9:b062:db3b with SMTP id fj30csp58783pvb; Wed, 25 Jan 2023 20:42:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXuI8wR+/iRYK9IyDY30WS6NCoDOQfjanOdVnSa8rsgHKfxHxUS8kxnA11/xhemAWY5IsZr7 X-Received: by 2002:ac8:4504:0:b0:3b6:2f11:25a4 with SMTP id q4-20020ac84504000000b003b62f1125a4mr49577706qtn.16.1674708157151; Wed, 25 Jan 2023 20:42:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674708157; cv=none; d=google.com; s=arc-20160816; b=lT/9VaoVZ0cYNvp2fMy80SBjkkIVvV4RtFT24Oi/zmaJHBf/MG2zizr/yARhyl66xT l9y4YWu+XcSRNf4OhJxMhceqofpJz4WDqBix6zVPpyLuG/1y83e9BMmDz/kKbjpkFV/l sGe1XoyGDSJqWrTbeB6fh/+NK08wJL2t4Gjn1qEVjlJaEpA5d5dlcXt7Jw8dvB3ct4nL t4BfIuH71QrfnKZDv/xEuizcCHO996vtF31TCSDy+EOwbV13BVVo3P+rJB62qH649DIx LR5BzY+/W9dMk0q7gdOusZThhUrPr7E969AzCBJtEqG79UJKwCthJX+OMlLeLL4+C5wA HA+Q== 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=+sAayCS/0n8o12l1+Nu9dY41aCtQpJmApolHzbMbLL8=; b=a4MFg6ivvLox8fLaAXl7wnYtXOk0OGPt5XFhuFrU1dOYyh1rcHWr1ocFbZLAGGDLIT yqsucSeejV9yxgFK4h1YcXxchgcW7EgWxMMq0/7a2cURf/YraXR1rjTi3bSDjwNAMuRV un/Gu5MBpEZH8N9xCsT8MSD5hW/HV8dhErvzyWDTZTQkHC0DI35YsZKjXrhSF2opYb/K ukg2dNo93/NtK9dRWpQh6Fpg/7gMY9w4X4JoOfbYkLM+T8/wWs3lmJNCFiaoPK8fMJL9 ofwc7/TOBvB3UYEfB+thOG3lMUXcMC0RA3F3K0zsxP+fbnSI1tASyQ407vEDhypo6P4c NwmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NeYD11B0; 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=fail (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 w16-20020ac87e90000000b003b6429fc201si164667qtj.7.2023.01.25.20.42.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Jan 2023 20:42:37 -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=fail header.i=@linaro.org header.s=google header.b=NeYD11B0; 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=fail (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 1pKu26-00007W-Sg; Wed, 25 Jan 2023 23:38:42 -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 1pKu25-00006h-5r for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:38:41 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKu21-0004ON-Tq for qemu-devel@nongnu.org; Wed, 25 Jan 2023 23:38:40 -0500 Received: by mail-pj1-x1031.google.com with SMTP id o13so538635pjg.2 for ; Wed, 25 Jan 2023 20:38:31 -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=+sAayCS/0n8o12l1+Nu9dY41aCtQpJmApolHzbMbLL8=; b=NeYD11B0N8/wIy7wpHawxSplemFxpN57G8mMXJCwRdpTVg1rn/af4aTTh3i//6UDLl epD4E22y5l/Rr2cHGAY/+Sb1UhL/fKF/PBW5gXmIOWzQ9Okt/pvVUktKkte96GjMmDYI s+cZcL8wCw8k5o/jhP/Moub+bYdOcg69Hws5CDmBLngMh6aGgV7/0Xe6/hIFL/vObNvR 4PoDNV2RFkFLoy28WShcNvH1p59PoPOrMHdVd0ptor1a3rFVUmLYPo/1EObSdemTmD+o JndqK7yjAFnRrmq1TUm+8kVmTChxzBda3vrYmfxpvSvTvVnXm0nI997BeAGU7EMeAiaU 1nxg== 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=+sAayCS/0n8o12l1+Nu9dY41aCtQpJmApolHzbMbLL8=; b=unznZcPwb6UkB09v9LzJGN0rCBmNtjyqNuTjnv0Dzo4FS0oeOT/zLVIZMsWKyGLx3m RoxkRtncJ7hNXik58XPr+Z0uzigL9t4GDdjhuJt2h7kmGpZ+BSxwYalZcQnJqqeJ7N5M ScUD+eUtpX+LFgftT3ruagCNRAwunoMJViP1/Qj7jzUahNLLAZ3k+Qt3OSufONBUn4uV B4whyKKRW3r91613R8KcxcZLNeNib+ijG5PAj5gRZwqXrtCJgvFGyaim8Vbs5z9bPpQU rFT/dlCzu2HbJZ73+p+ps9EAswhvfh5XYXF0FJjCPUF6oQtchNtABZIHmA41NKItJ6q7 Fq5Q== X-Gm-Message-State: AFqh2kpbV/RQmwAMLtOfwek4coTbi+1J/JcSonfJK98Fj3lYysahPu02 ZbfGtSA9fz+ItqPaND7cU4oXF00vsrawFwjCJfI= X-Received: by 2002:a17:90a:d344:b0:229:ef6c:4139 with SMTP id i4-20020a17090ad34400b00229ef6c4139mr25572738pjx.22.1674707910921; Wed, 25 Jan 2023 20:38:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 20:38:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH v5 02/36] tcg: Handle dh_typecode_i128 with TCG_CALL_{RET, ARG}_NORMAL Date: Wed, 25 Jan 2023 18:37:50 -1000 Message-Id: <20230126043824.54819-3-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::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 Many hosts pass and return 128-bit quantities like sequential 64-bit quantities. Treat this just like we currently break down 64-bit quantities for a 32-bit host. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/tcg.c | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index d502327be2..ffddda96ed 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -707,11 +707,22 @@ static void init_call_layout(TCGHelperInfo *info) case dh_typecode_s64: info->nr_out = 64 / TCG_TARGET_REG_BITS; info->out_kind = TCG_CALL_RET_NORMAL; + assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs)); + break; + case dh_typecode_i128: + info->nr_out = 128 / TCG_TARGET_REG_BITS; + info->out_kind = TCG_CALL_RET_NORMAL; /* TODO */ + switch (/* TODO */ TCG_CALL_RET_NORMAL) { + case TCG_CALL_RET_NORMAL: + assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs)); + break; + default: + qemu_build_not_reached(); + } break; default: g_assert_not_reached(); } - assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs)); /* * Parse and place function arguments. @@ -733,6 +744,9 @@ static void init_call_layout(TCGHelperInfo *info) case dh_typecode_ptr: type = TCG_TYPE_PTR; break; + case dh_typecode_i128: + type = TCG_TYPE_I128; + break; default: g_assert_not_reached(); } @@ -772,6 +786,19 @@ static void init_call_layout(TCGHelperInfo *info) } break; + case TCG_TYPE_I128: + switch (/* TODO */ TCG_CALL_ARG_NORMAL) { + case TCG_CALL_ARG_EVEN: + layout_arg_even(&cum); + /* fall through */ + case TCG_CALL_ARG_NORMAL: + layout_arg_normal_n(&cum, info, 128 / TCG_TARGET_REG_BITS); + break; + default: + qemu_build_not_reached(); + } + break; + default: g_assert_not_reached(); } @@ -1690,11 +1717,13 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int nargs, TCGTemp **args) op->args[pi++] = temp_arg(ret); break; case 2: + case 4: tcg_debug_assert(ret != NULL); - tcg_debug_assert(ret->base_type == ret->type + 1); + tcg_debug_assert(ret->base_type == ret->type + ctz32(n)); tcg_debug_assert(ret->temp_subindex == 0); - op->args[pi++] = temp_arg(ret); - op->args[pi++] = temp_arg(ret + 1); + for (i = 0; i < n; ++i) { + op->args[pi++] = temp_arg(ret + i); + } break; default: g_assert_not_reached();