From patchwork Fri Feb 2 05:50:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 769177 Delivered-To: patch@linaro.org Received: by 2002:adf:9bca:0:b0:33a:e5bd:fedd with SMTP id e10csp755291wrc; Thu, 1 Feb 2024 21:58:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1B1Nhv7CSk1RmLWlQCQuOjCpxYXASB11yQqGwuS+9/5rB55sUR7fsUlEgPmah16WHW8b1 X-Received: by 2002:a05:620a:2954:b0:785:53d9:8aa9 with SMTP id n20-20020a05620a295400b0078553d98aa9mr1314164qkp.9.1706853518857; Thu, 01 Feb 2024 21:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706853518; cv=none; d=google.com; s=arc-20160816; b=m5WmlEIfFHbF/IvxN3BykSIVVLu12Redw/bcQovq4XJriHVsY0FNkooFZ9N07Wj/Mt wmed/AiqP9y0fCQceLOzO5vJDjvV/gkJ53+v1/zzOAbQ2MzdVFjl0lh75WYvHxWaRzWX vIk/kWNpgronAoDYsDm76/i7ITco+JRYp3dlejHZu4JYaYpS57S6UZUjLXJ/oztwRULp cDKgiNZaCLBgcuQ50s8Bc8O1KF6czVXI7jfZHCheCV0a4vtwiutsk0dd00zdcpPXuzU5 ZG9rrCjDQfPoK9P1q6Al+6ovAudDVhoXRy5/JOq7PTO9pO+88bq+HtsLc4CGGO3h9jLQ 7OjA== 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=1eKYzACMAdv41jwhWgL5ua1c7uVrjKcVx/en63NM27s=; fh=fJ2JQlZjGeuSSbzKvU8onAXsxTfLLjE/3fwNCZhXUmY=; b=q5iw8Y6eFWRZcIjXIJK9FSgQSnr4XgTNt+6LNX0+ariqnDoyZj2Yr9TbJhdpaOd+Z4 oeiu3AGbwNr75jjzPYO4IuBx5yvnq40d/xaR7nxDr0538nXOuIxxb3h71y0LSORRzjwK LoHo+olQ7c1CId97lAyTFjqGE1DbCCGxk+vAbeNH9oJsOcNPnSyzQ4GIbWcygjaUHjOZ BYgcW4069pcCoci3gfTBgABNDFQlM4rqTEERXh3ssEKdSpHJtbMz0JqM1GUNlPwwTbEm pBbjwE+l6ECtWr8ZxDDn6EUT8G1cW6KhVnN0XXehZl0DJZthN8s1hlqe8UjD2e0qfmeT xLxA==; darn=linaro.org ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Un+2cmmK; 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 X-Forwarded-Encrypted: i=0; AJvYcCW+ALwywGdN/PCCNdFqcx+P2R5/UyFHok2S6AgPLQmvYozS9Xv59EePLXZgkAMtKiUJ3Th+37Ocbg5v6YgUJSCG Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c23-20020a05620a11b700b00783f16eee24si1290979qkk.91.2024.02.01.21.58.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2024 21:58:38 -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=Un+2cmmK; 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 1rVmWS-0006OR-S0; Fri, 02 Feb 2024 00:55:32 -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 1rVmWQ-0006Cm-DO for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:55:30 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rVmWO-00032B-Ld for qemu-devel@nongnu.org; Fri, 02 Feb 2024 00:55:30 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d7232dcb3eso13086465ad.2 for ; Thu, 01 Feb 2024 21:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706853327; x=1707458127; darn=nongnu.org; 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=1eKYzACMAdv41jwhWgL5ua1c7uVrjKcVx/en63NM27s=; b=Un+2cmmKr7DLm119jEA9RAd0FY1OU15gB3k0E05KG2j/Sqadpv7IkNcSgsS0ZTnPg4 SIZ63wulz09xFNC6BQ02Ppuw8v6bJr2AOU95FNJ+ly10ongHb//NpHlB0dHRV+tkRCQp Sadc3uT2tPtt2G2T0zywcO0Edb5jsiDv43LD2xO3MvjrNHbAOJEVIL0mCi+o3E68BJhq EnvrESgmdv5t7nhhojA+VLQ5q6D1snBRmt/ePmTWICbo7rDTwUWnxy5ERUzVIqG4aBsX PGc0uS1QADwKDamxHr7ZV2lgNYZ5PpcATi08djbvzSq5SeQYtN78ZG8uKl9NQNgp3fZU IEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706853327; x=1707458127; 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=1eKYzACMAdv41jwhWgL5ua1c7uVrjKcVx/en63NM27s=; b=UjRga4C14WczxeyAusZ9hpDsDR0EKUym9rKwnMlv6KDGUOsTK6prPbW9UW9t9Dr1ip tCdDiNq6L1bPhU5DWKOl5ajUQTZPhITZxra8xFvsNjao0BOsV3h3lg5X5NoxIFVIcWZS CbuOL1Ddhy/pJ4v9gb+PYEuovNnov0AttdLEslgN9mrKpCu7miFo6OrNz7HMb9YwKDGA xG+5WEXtCMKNAM3cTHy2CAK2+picd5YAyjejlH+H2X3ltebMNDUGLdLbcQRYbMEE0z4g qGObSR0ugXz4r98FfoGlmQz1rsHoAUm255p0YFcfXxQCZMiRN9uA+aA/pceC/DGA0ZdO Ny0w== X-Gm-Message-State: AOJu0YxWzJYnTYpsDW5lcwGFk4W1DfezD599iGwFnPeaoaYoYmyW4MFd BA2u42wk8ktjIXBUvLi2lvZultMyeLojulbTIq05rNZ7EHmuvRpOnGpJg9OassXkU9eDcQ+TRRc C78w= X-Received: by 2002:a17:902:ef92:b0:1d9:2cda:afe5 with SMTP id iz18-20020a170902ef9200b001d92cdaafe5mr1164021plb.31.1706853327222; Thu, 01 Feb 2024 21:55:27 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id je5-20020a170903264500b001d8a80cbb15sm752059plb.238.2024.02.01.21.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 21:55:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 48/57] target/sparc: Use i128 for Fdmulq Date: Fri, 2 Feb 2024 15:50:27 +1000 Message-Id: <20240202055036.684176-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240202055036.684176-1-richard.henderson@linaro.org> References: <20240202055036.684176-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Signed-off-by: Richard Henderson Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Message-Id: <20231103173841.33651-14-richard.henderson@linaro.org> --- target/sparc/helper.h | 2 +- target/sparc/fop_helper.c | 8 ++++---- target/sparc/translate.c | 15 ++++----------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 20f67f89b0..f7aeb31169 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -84,7 +84,7 @@ DEF_HELPER_FLAGS_3(fmuls, TCG_CALL_NO_RWG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fdivs, TCG_CALL_NO_RWG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fsmuld, TCG_CALL_NO_RWG, f64, env, f32, f32) -DEF_HELPER_FLAGS_3(fdmulq, TCG_CALL_NO_RWG, void, env, f64, f64) +DEF_HELPER_FLAGS_3(fdmulq, TCG_CALL_NO_RWG, i128, env, f64, f64) DEF_HELPER_FLAGS_2(fitod, TCG_CALL_NO_RWG_SE, f64, env, s32) DEF_HELPER_FLAGS_2(fitoq, TCG_CALL_NO_RWG, i128, env, s32) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 9a0110e201..cd9b212597 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -129,11 +129,11 @@ float64 helper_fsmuld(CPUSPARCState *env, float32 src1, float32 src2) &env->fp_status); } -void helper_fdmulq(CPUSPARCState *env, float64 src1, float64 src2) +Int128 helper_fdmulq(CPUSPARCState *env, float64 src1, float64 src2) { - QT0 = float128_mul(float64_to_float128(src1, &env->fp_status), - float64_to_float128(src2, &env->fp_status), - &env->fp_status); + return f128_ret(float128_mul(float64_to_float128(src1, &env->fp_status), + float64_to_float128(src2, &env->fp_status), + &env->fp_status)); } /* Integer to float conversion. */ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index d478a2fcd0..d12de5ae5c 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -276,14 +276,6 @@ static void gen_store_fpr_Q(DisasContext *dc, unsigned int dst, TCGv_i128 v) gen_update_fprs_dirty(dc, dst); } -static void gen_op_store_QT0_fpr(unsigned int dst) -{ - tcg_gen_ld_i64(cpu_fpr[dst / 2], tcg_env, offsetof(CPUSPARCState, qt0) + - offsetof(CPU_QuadU, ll.upper)); - tcg_gen_ld_i64(cpu_fpr[dst/2 + 1], tcg_env, offsetof(CPUSPARCState, qt0) + - offsetof(CPU_QuadU, ll.lower)); -} - /* moves */ #ifdef CONFIG_USER_ONLY #define supervisor(dc) 0 @@ -4992,6 +4984,7 @@ TRANS(FDIVq, ALL, do_env_qqq, a, gen_helper_fdivq) static bool trans_FdMULq(DisasContext *dc, arg_r_r_r *a) { TCGv_i64 src1, src2; + TCGv_i128 dst; if (gen_trap_ifnofpu(dc)) { return true; @@ -5003,10 +4996,10 @@ static bool trans_FdMULq(DisasContext *dc, arg_r_r_r *a) gen_op_clear_ieee_excp_and_FTT(); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); - gen_helper_fdmulq(tcg_env, src1, src2); + dst = tcg_temp_new_i128(); + gen_helper_fdmulq(dst, tcg_env, src1, src2); gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - gen_op_store_QT0_fpr(QFPREG(a->rd)); - gen_update_fprs_dirty(dc, QFPREG(a->rd)); + gen_store_fpr_Q(dc, a->rd, dst); return advance_pc(dc); }