From patchwork Sun Oct 22 23:29:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737055 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1283025wrl; Sun, 22 Oct 2023 16:34:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvuVQ+I4LmKHJbYxsJdwOuEfaT4tY1myXrPriW790iZTDxx+g4t0IdDrkqmu0Pl1FKL+Za X-Received: by 2002:a05:622a:1187:b0:41c:cd2a:f066 with SMTP id m7-20020a05622a118700b0041ccd2af066mr9585766qtk.34.1698017689569; Sun, 22 Oct 2023 16:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017689; cv=none; d=google.com; s=arc-20160816; b=X/4BLmhTb1+8LqD32g2ty/Y5H4i1qZ07kAqacGRCI5PdFF/NS8J8M3vhBtAeXTp8AE teCNwx2YaQFaoRNXB7ybtWv4msB6O0iMR/B6nYL9eHbWlb3ZiLYKRjpUYyDFCe7a3JwO gUZ5u3s0zK99qLU46DaiuXTJ5JXxVvRbw/VNwP66YVnN7/nVd9IA6PACE9WrK32HcGHW KOExhHhqxg9KeKPv8iNX6nTppXOHNxRJonSW9usqbMMPUG/4BZO7tr/XOZDJGsNgQMWZ WLbH14aSeZ1tRYcSyuI/THFNaFkOTgtAEFO6JnMFMO0CObypDZM0RPH/ufY59iUSj414 G4gg== 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=QNsHxI8bIzopE9R3HNUQ8PwyH45Fz5eZKoBnXj6h7VQ=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=IZhb3ulz8RExF4mGlE0YyNQol2CaLKYOV/OmgOCIoeCMoXSWl0vHGWrIVOIE/++KpP 0d+9oCOrITBmlq6Uv+CyaLrWb5G5XA4c/AZKdD2h10xumXx1Zuy0elsDA0FjnZqs5+su dMpxids0w0zn6jDzSUF8rS4x29XfNjP+hif4aWoQIa9lEvmHD6y8Pbd9Y/NqACvGQrNn yB8m/jqmEfK6hg2f4Ow+9cll7lKzYijEB8IUx5HQtDdXtaITG8XmbhwZHABlR4Xi0GAA KsZ4L3U0FIdg4p15yva7V3zEThHIA1E5CbFWnaNhuimvtQuY5+LzPPIajCtkZSlCSPm+ ji4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UZI3g9Uj; 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 u4-20020ac858c4000000b004178c9b7d0bsi4683060qta.328.2023.10.22.16.34.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:34:49 -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=UZI3g9Uj; 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 1quhx8-0006yF-7T; Sun, 22 Oct 2023 19:33:50 -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 1quhx0-0006YL-4P for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:42 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhwv-0007lS-PH for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:41 -0400 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-7a67f447bf0so107987539f.2 for ; Sun, 22 Oct 2023 16:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017616; x=1698622416; 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=QNsHxI8bIzopE9R3HNUQ8PwyH45Fz5eZKoBnXj6h7VQ=; b=UZI3g9UjL2QGV0MZ1N9thoGZwiJniSI1Xxd3LkLiidm/l9r5isYxHEnNb9iP0pphUv XtvMyZYOIxfqtfh/0ShnZzsi7uMoGpfDmGLMt0FKMzMzwJUS9iKOX0D0LWBFxd/II+XF aL0buv8/Oyw6YFVp3ERqDMeei/Q5PzPX6Bp4kiMp0UngQWyO/0BGHouZTyX8C3TVQO6W QUofPsKnBPGVDJF1d4c6a3klHplnIXU+K18+bzaEEmPlSzDGr9z3OjSnZmN2J0U0e5Gz g55X1BSm0PwblrQ82FGE64OUMvPZ6qTbWKoZEqprdzUnfZpSgOz6rv1XqgMTacHsqBsZ jW3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017616; x=1698622416; 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=QNsHxI8bIzopE9R3HNUQ8PwyH45Fz5eZKoBnXj6h7VQ=; b=OhCM5/Adj0HzkRMBjt6UIble+xnGRunD9Zi4xueo4OmqUzc5u4CJ+146V/QKyjvIFt 3m1Ck6Ov8g9ssgjH5BQYyrNKsNxtHXohXiHk8Ah2rxvAC3MsdmLXiLh+A2lbN4Et6xPH 8v2cSaDgay3lbaibNVHxkn4+zYsUT/ldlpclxV6ySLiFKvKZyBAZNyAnyJOg/q1t/Q1u ezjK9ognMOR6zZGLty1GI6MU5Uh26bwlLyXdC3Pqg7LMTgAcK/JIojrhIP9wlEccsX4+ ZNX2FUNBREXyHxCAp41LHpKYSBGWtd2te16oD0dy6rAy4drupGHIVSgkp2X2R1dTHVzU PJew== X-Gm-Message-State: AOJu0YyGZJrhqOz6s/+9BHC/jlAwC4V5DVTgm2geCixB+BytFWUB9cce zGBRaNhDolJJJ/9Jm5J2W5yhwwKkjFFCpWhihV8= X-Received: by 2002:a92:d2d2:0:b0:357:70f3:c431 with SMTP id w18-20020a92d2d2000000b0035770f3c431mr8900352ilg.9.1698017616567; Sun, 22 Oct 2023 16:33:36 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0066a4e561beesm5182855pfb.173.2023.10.22.16.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:33:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 74/94] target/sparc: Move gen_fop_FF insns to decodetree Date: Sun, 22 Oct 2023 16:29:12 -0700 Message-Id: <20231022232932.80507-75-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::d2d; envelope-from=richard.henderson@linaro.org; helo=mail-io1-xd2d.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 FSQRTs, FiTOs, FsTOi. Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 47 ++++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index bc449023dd..85464285b7 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -245,6 +245,9 @@ FNEGs 10 ..... 110100 00000 0 0000 0101 ..... @r_r2 FNEGd 10 ..... 110100 00000 0 0000 0110 ..... @r_r2 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 +FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 +FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 { [ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 25f3fea74e..db964002b7 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1654,20 +1654,6 @@ static int gen_trap_ifnofpu(DisasContext *dc) return 0; } -static void gen_fop_FF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32)) -{ - TCGv_i32 dst, src; - - src = gen_load_fpr_F(dc, rs); - dst = gen_dest_fpr_F(dc); - - gen(dst, tcg_env, src); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_F(dc, rd, dst); -} - static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i32, TCGv_ptr, TCGv_i32, TCGv_i32)) { @@ -4803,6 +4789,27 @@ TRANS(FABSs, ALL, do_ff, a, gen_op_fabss) TRANS(FSRCs, VIS1, do_ff, a, tcg_gen_mov_i32) TRANS(FNOTs, VIS1, do_ff, a, tcg_gen_not_i32) +static bool do_env_ff(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_env, TCGv_i32)) +{ + TCGv_i32 tmp; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + tmp = gen_load_fpr_F(dc, a->rs); + func(tmp, tcg_env, tmp); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_F(dc, a->rd, tmp); + return advance_pc(dc); +} + +TRANS(FSQRTs, ALL, do_env_ff, a, gen_helper_fsqrts) +TRANS(FiTOs, ALL, do_env_ff, a, gen_helper_fitos) +TRANS(FsTOi, ALL, do_env_ff, a, gen_helper_fstoi) + static bool do_dd(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i64, TCGv_i64)) { @@ -4964,10 +4971,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x2: /* V9 fmovd */ case 0x6: /* V9 fnegd */ case 0xa: /* V9 fabsd */ - g_assert_not_reached(); /* in decodetree */ case 0x29: /* fsqrts */ - gen_fop_FF(dc, rd, rs2, gen_helper_fsqrts); - break; + case 0xc4: /* fitos */ + case 0xd1: /* fstoi */ + g_assert_not_reached(); /* in decodetree */ case 0x2a: /* fsqrtd */ gen_fop_DD(dc, rd, rs2, gen_helper_fsqrtd); break; @@ -5023,9 +5030,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_QDD(dc, rd, rs1, rs2, gen_helper_fdmulq); break; - case 0xc4: /* fitos */ - gen_fop_FF(dc, rd, rs2, gen_helper_fitos); - break; case 0xc6: /* fdtos */ gen_fop_FD(dc, rd, rs2, gen_helper_fdtos); break; @@ -5055,9 +5059,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fdtoq); break; - case 0xd1: /* fstoi */ - gen_fop_FF(dc, rd, rs2, gen_helper_fstoi); - break; case 0xd2: /* fdtoi */ gen_fop_FD(dc, rd, rs2, gen_helper_fdtoi); break;