From patchwork Sun Oct 22 06:00:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736962 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1005788wrl; Sat, 21 Oct 2023 23:12:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCM64Ry8/W9dS4RkpSgiTSiJM5hzKgUZaCOO2/p5wYcxeGVYL5bEAm7N9Ygi07L+LqQ8nw X-Received: by 2002:a05:620a:284b:b0:777:5b4e:e52e with SMTP id h11-20020a05620a284b00b007775b4ee52emr6285090qkp.66.1697955143277; Sat, 21 Oct 2023 23:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697955143; cv=none; d=google.com; s=arc-20160816; b=OqWC3jTl5KuwtvOLYToL1ehRLtTlFoLix+hefqn9Y2Z7EMVyRex/kTfatE5N3HTCNM +nqIUcUw5QPlGB14GamdSbBzNXmZtywXOBq0HKBvx4nJIXInnrCzCrh7t5CI82qwOikR 16WeagoG7moqkDQnEFB9v1eLF4H/0dp4EWjzHs9DCXjv/jZDisjf3kkLxZGUh9eNcqPu w/nosgfxphgY1KkWkJGfv791vqfDh9bQMvV3/WRLuiR1h0atPC8ZMg+izMhQ5U8DmxHr kCWWH1UrOzSWyDQTr6+eVtqbIhU2vRFgEYafuI7aHwi7ay5Pf4u4xn0ekdDXbEbqeiiL +FUA== 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=9TKr08lEUaGVu+t150hWUxpw8P0o9Xs1m7wUe0676Uc=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=b4EEY+yjIKm9NqExxCDP2uJBHiiufrtVZfhG7gPsWBNxNBzk4Maa7fSktjzp0x7ePg i6X/aE/VBffytjXZziHovdOuG8SHRHV2kFHgH43u3/Z3bH8l0NKso0f6AhpHKF1mQyyt gbLiUkkkn9KDMpVOkcoUJ3C9czEA5Aq5RBxSwOh6JBGQfHoxbeyNDyQ6eMFC+Zmh8vrf kgAh5QvpYkzoq+0ItknAQh80lKUqxQSvfUkWS6EIQfTMnecoKEh0DahMXN8b5RrDbEnX jimbEgknrfz7h7ZvxwWhyUs+LLiteV8Sg0l+oQ34ANTJvk7DH8tT4PH6MEClO9/rffvM rZFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lsZq1qUn; 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 i7-20020a05620a248700b007758e273104si3759015qkn.334.2023.10.21.23.12.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:12:23 -0700 (PDT) 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=lsZq1qUn; 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 1quRb4-0004NV-5R; Sun, 22 Oct 2023 02:06:02 -0400 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 1quRaE-0001lb-Ky for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:05:06 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRaB-0002KH-Sr for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:05:06 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-581de3e691dso1357515eaf.3 for ; Sat, 21 Oct 2023 23:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954702; x=1698559502; 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=9TKr08lEUaGVu+t150hWUxpw8P0o9Xs1m7wUe0676Uc=; b=lsZq1qUnQ8F8OCgQxFYCbKRmwYAxtBknTyU8+wH5vrDRJSHradwZaPTqHY1WwpJSl1 avTaPjxqoNxl2VhQH2BHUNAqnaUPgELcdXYFmLweO/GnZqKQktuyVrhSPrJMiNHTtKfC XI5haNaZ08unkeGgJr/cYlnGmbwwOhKDgEpOM+yjxf4exc6O/T12MbZN0t96HdlCSiDC b/+2vb9mA2Ym9JdNMPqnlli/TgnKT0VbZ7JIUFNOpYoSm6ePdDHzWScGJkq45n+gX3jA ezApeGnXwAc8XuzjrgGV/fdREuImIh2kIi84oi+4am8/odtB9hdj6YUWHyOJ4mSNj7T2 rv7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954702; x=1698559502; 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=9TKr08lEUaGVu+t150hWUxpw8P0o9Xs1m7wUe0676Uc=; b=Wg+P7It1mSVJJFntQtBBp7IjbNy1JkXYCmzIjkrPzHrrx3VcECdd1vYDgYMQ4MiwUL Uc7qivaFwkScU4UW70yNz+96Rn3eDAJw362M28bS5hgjziU/RZ0Ea0bhCYKzBexoquJy iw646kK+K5SFXWseNEHRpdUD+0r3OPlrYLaZWkE4FTsxW7ieXNHEuqvbhiB7ijVa60VJ c6G8cs6hzw9lbQwtfRYKFAccnSCaYUV7Yl6Zid/Y9B8G+zcfDVq289sgR2A3CqzVCjEj GqrxL7v1k1Jp5VZdZbnzgdTCYI6b1tUN9H5dKY1/M7werEgb1y39prtF/hbLhD7vRZJM 6KYQ== X-Gm-Message-State: AOJu0YwW9fGnBajXMQT9BPpVqzyIYyv9oiV5zHtjNuiuA2Lj60vAHkAG 3qAOkt8lzVA2TvPGd8QVNugPG0hzxWtzHHDN+28= X-Received: by 2002:a05:6359:1b82:b0:168:d161:c907 with SMTP id ur2-20020a0563591b8200b00168d161c907mr1629175rwb.18.1697954702268; Sat, 21 Oct 2023 23:05:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fb13-20020a056a002d8d00b0068a46cd4120sm4007373pfb.199.2023.10.21.23.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:05:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 72/90] target/sparc: Move FSQRTq to decodetree Date: Sat, 21 Oct 2023 23:00:13 -0700 Message-Id: <20231022060031.490251-73-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.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 Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 1 + target/sparc/translate.c | 39 +++++++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 1d766fab21..4cb250265d 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -247,6 +247,7 @@ FABSs 10 ..... 110100 00000 0 0000 1001 ..... @r_r2 FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2 FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2 +FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2 FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 1d046151d9..acc8f5d8cd 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -71,6 +71,7 @@ #define gen_helper_fpmerge ({ g_assert_not_reached(); NULL; }) #define gen_helper_fexpand ({ g_assert_not_reached(); NULL; }) #define gen_helper_pdist ({ g_assert_not_reached(); NULL; }) +#define gen_helper_fsqrtq ({ g_assert_not_reached(); NULL; }) #define FSR_LDXFSR_MASK ({ qemu_build_not_reached(); 0; }) #define FSR_LDXFSR_OLDMASK ({ qemu_build_not_reached(); 0; }) # ifdef CONFIG_USER_ONLY @@ -1682,18 +1683,6 @@ static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_D(dc, rd, dst); } -static void gen_fop_QQ(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_ptr)) -{ - gen_op_load_fpr_QT1(QFPREG(rs)); - - gen(tcg_env); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_op_store_QT0_fpr(QFPREG(rd)); - gen_update_fprs_dirty(dc, QFPREG(rd)); -} - #ifdef TARGET_SPARC64 static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, void (*gen)(TCGv_ptr)) @@ -5005,6 +4994,27 @@ TRANS(FSQRTd, ALL, do_env_dd, a, gen_helper_fsqrtd) TRANS(FxTOd, 64, do_env_dd, a, gen_helper_fxtod) TRANS(FdTOx, 64, do_env_dd, a, gen_helper_fdtox) +static bool do_env_qq(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_env)) +{ + if (gen_trap_ifnofpu(dc)) { + return true; + } + if (gen_trap_float128(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + gen_op_load_fpr_QT1(QFPREG(a->rs)); + func(tcg_env); + 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)); + return advance_pc(dc); +} + +TRANS(FSQRTq, ALL, do_env_qq, a, gen_helper_fsqrtq) + static bool do_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -5150,11 +5160,8 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x2a: /* fsqrtd */ case 0x82: /* V9 fdtox */ case 0x88: /* V9 fxtod */ - g_assert_not_reached(); /* in decodetree */ case 0x2b: /* fsqrtq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQ(dc, rd, rs2, gen_helper_fsqrtq); - break; + g_assert_not_reached(); /* in decodetree */ case 0x41: /* fadds */ gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fadds); break;