From patchwork Sun Oct 22 23:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737065 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1283274wrl; Sun, 22 Oct 2023 16:35:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWK4yAcXr+OkMVipPX78UlHfpohh5oyG6CjDI8IWn0ocbmVX03pW8pNoyZkdUgELkkPI2q X-Received: by 2002:a05:620a:bce:b0:774:215e:2b23 with SMTP id s14-20020a05620a0bce00b00774215e2b23mr9562619qki.41.1698017747802; Sun, 22 Oct 2023 16:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017747; cv=none; d=google.com; s=arc-20160816; b=uOMRsYvJa5j+PWhel47IXCy85oNPg0zx7HUDP8bhrOxijgNpSPIlALEep2KQP6R4pi WgyLI2NLZzOAuxFWWJ+AL8ruBzrd+cu4on8Rthr2j33PUgmKYOhvo+bVrzFZ5sBlN75Q AoWdNq09gaTk69BgtQCj+0icaUp3VFh4gRcwn8yCjz8irmUuZCjJ5MhsOmp0/Ltfj1Bz AQ0YwNVVYSQsZ86xi2eTpHEWWm28DCr8IY9U9Vfe9VvxEieSviqp3EIjFNNY3s14utqN Hppm3jkGv0aE/c56MAD/7A/yJJ/a0s98V/+fQiDwlSqZ4j3HwIcz3IguosCcHnzTJB7Y hu8w== 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=lEF0e3z4tZOsUobPk2dIjbpQ9BugYkiniYO4Z9beEcQ=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=E6qE7KRzrpuJwd0UZjeIoBgONZAQTm+aOPBal3fgxmw0+D3j/e8UYx8BwEvhNkcvE+ ePZEBERzzW6CNouhnLKMy4QEdOEkHxPE8x/imsbZoUPaHcsSI01RGv9L63N0/rcCBxcg YvRho0um/QSJkxDaQBEHn0c6RM/F3jc/EgM2A3lajO9yh5dIMw+DdI0uQBSsjLBMlO3Y SHTElo+c4/oTIcCejrdxhafN/ZV43a8ivo+dPyO0xHAj3tUYF1KuJ4nEE44sdg7DVIhc d5wSYR6w6B/8ZqutVsaOfLmXpRB7pKjvzXrIy3Z4lgGOw6I0PB5qaCJs03fapFvRWsIY bQRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u2ID6KZW; 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 v9-20020a05620a440900b007759c1ebe6bsi3903924qkp.399.2023.10.22.16.35.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:35:47 -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=u2ID6KZW; 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 1quhxB-0007SA-Ne; Sun, 22 Oct 2023 19:33:53 -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 1quhx2-0006aU-Vb for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:45 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhx0-0007oE-6I for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:44 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b1e46ca282so2735485b3a.2 for ; Sun, 22 Oct 2023 16:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017621; x=1698622421; 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=lEF0e3z4tZOsUobPk2dIjbpQ9BugYkiniYO4Z9beEcQ=; b=u2ID6KZW/aN0bvWozVjG8Yxi+SQVQOH3cKC25wM5n7c+cOr8bby1ZvW2cSoANsowOz fXdn+6VYSLlPhPoBC0P9koIBtP68dakhMcFGWeglpxvFWZirtEQ4Uivao/eEoYODwnt5 xpEXKSfWhMydvKF89EMlhRZgxF22Dv0o5sNtD+v2pjReT/aiP0hdbfKoTlII01yZFxam 3rWWTsevsuexCe1cJu68rLFaxMtkYACTfYs0gb3+pkKvPd6XsQsOssR42nj5fhEszrHg iR5GjjVFm93kT/WJT8or0MIeEAlqlpPnKX5oVtsA8/9taW30p+ep6ZwWccvXkXDXODxm eu/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017621; x=1698622421; 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=lEF0e3z4tZOsUobPk2dIjbpQ9BugYkiniYO4Z9beEcQ=; b=MOVJsslYYswdlUfiuximKf9QYMs8ZkiMi9mhw+6cxI6uPhn0+cO5EsCjoDt4OIlMnw 21MMIr8LsJ2ClBdTr/mUECZA8/lyCwv0K4cWwoBc54MZf1W9P1QjWmC2Jr5Y9dxTdavi pzlRoACoJZc5pr8CuXElQJ1JUgPB3BUG4W42KU/IdQ8B/2xRWAzBccLGEI5gyh+m1tRj os17Ujya70D05vRX6VOr3xPO+C0pC7SgKEhz+vuNC7C3cNKj9ne97c8sk/1GMJizWG+O Ns2qKHyCRlybmNngSakk7656JbUkxVE9P3AcTriGHgMOyBNMxFnOaSGatPjfC7MRbuL5 GreQ== X-Gm-Message-State: AOJu0Yy8wlpQn/D7hJ0rKUe9WdTCbNv7JukJH5NfnGPNrTi2aY88ESea rNeixWXooHQZjIQaqw/9zLxeZbZ7xQIcZafurqg= X-Received: by 2002:a05:6a20:3219:b0:17e:2afd:407f with SMTP id hl25-20020a056a20321900b0017e2afd407fmr1844739pzc.9.1698017620854; Sun, 22 Oct 2023 16:33:40 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0066a4e561beesm5182855pfb.173.2023.10.22.16.33.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:33:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 79/94] target/sparc: Move gen_fop_QQQ insns to decodetree Date: Sun, 22 Oct 2023 16:29:17 -0700 Message-Id: <20231022232932.80507-80-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Move FADDq, FSUBq, FMULq, FDIVq. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 4 +++ target/sparc/translate.c | 52 +++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index a429c04980..f18fd99476 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -250,12 +250,16 @@ FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2 FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2 FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r FADDd 10 ..... 110100 ..... 0 0100 0010 ..... @r_r_r +FADDq 10 ..... 110100 ..... 0 0100 0011 ..... @r_r_r FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r FSUBd 10 ..... 110100 ..... 0 0100 0110 ..... @r_r_r +FSUBq 10 ..... 110100 ..... 0 0100 0111 ..... @r_r_r FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r FMULd 10 ..... 110100 ..... 0 0100 1010 ..... @r_r_r +FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @r_r_r FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @r_r_r +FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r 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 c38d09d34d..4eb14039bd 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1669,19 +1669,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs, } #endif -static void gen_fop_QQQ(DisasContext *dc, int rd, int rs1, int rs2, - void (*gen)(TCGv_ptr)) -{ - gen_op_load_fpr_QT0(QFPREG(rs1)); - gen_op_load_fpr_QT1(QFPREG(rs2)); - - 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)); -} - static void gen_fop_DFF(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32, TCGv_i32)) { @@ -4961,6 +4948,31 @@ static bool do_dddd(DisasContext *dc, arg_r_r_r *a, TRANS(PDIST, VIS1, do_dddd, a, gen_helper_pdist) +static bool do_env_qqq(DisasContext *dc, arg_r_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_QT0(QFPREG(a->rs1)); + gen_op_load_fpr_QT1(QFPREG(a->rs2)); + 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(FADDq, ALL, do_env_qqq, a, gen_helper_faddq) +TRANS(FSUBq, ALL, do_env_qqq, a, gen_helper_fsubq) +TRANS(FMULq, ALL, do_env_qqq, a, gen_helper_fmulq) +TRANS(FDIVq, ALL, do_env_qqq, a, gen_helper_fdivq) + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -5022,23 +5034,11 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x46: /* fsubd */ case 0x4a: /* fmuld */ case 0x4e: /* fdivd */ - g_assert_not_reached(); /* in decodetree */ case 0x43: /* faddq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_faddq); - break; case 0x47: /* fsubq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fsubq); - break; case 0x4b: /* fmulq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fmulq); - break; case 0x4f: /* fdivq */ - CHECK_FPU_FEATURE(dc, FLOAT128); - gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fdivq); - break; + g_assert_not_reached(); /* in decodetree */ case 0x69: /* fsmuld */ CHECK_FPU_FEATURE(dc, FSMULD); gen_fop_DFF(dc, rd, rs1, rs2, gen_helper_fsmuld);