From patchwork Fri Oct 13 21:28:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733285 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1678967wrv; Fri, 13 Oct 2023 14:33:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyZaY7h5D1dIGiIin7ir+fNaZkygquaZrPHJCFnnttUVjGks24rQ+6ELSRvV4vOhY1Yqnc X-Received: by 2002:a67:f4da:0:b0:452:94a4:9c59 with SMTP id s26-20020a67f4da000000b0045294a49c59mr23103812vsn.10.1697232817640; Fri, 13 Oct 2023 14:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232817; cv=none; d=google.com; s=arc-20160816; b=wRzoRFou1xeYK8Lvkp1Jt9b2Ns8VEshA8Vm/FterP7s34FHHSHqk6mO9ailrm1bn+L bcaKQvS0dLhglt7RHzPKRr19MmaVhdDSEo0RHE3TgkNJ8yQ1OoFV891QsuW3TkcujL4e i/SuENoUoBLzrXM03EyubWV3Oz0Xj8aAOMDbXFCX6NFg/9xgj9DZfNrToiWo4/KhWM98 Nr94MlXI/3hAGbkFSQkjZC45ASknLQuzAWVDFQSkbjNUcALZgiEnwqeXQjHqYlZKGtE+ B5/z09XcR3kmf+00qBIej7xseYEnAxeOjLz7yOF8b//6SBgXuc8QyA7PXxqjoLN5WDqU PvEQ== 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=0bSA2//wrqrp9x+dBDbiScNjiAckPEW5NolyefyLY70=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=fnWWN6bZsy2hpWBJhuFVgsi9Exy/XPkxy1g66RORPaTnv/ZFqPbjfX10APh7Y3NxAu z+DiodYjrmYesx8i6O1BRHoY4w6qVtEWOMkLfeOwXrWAEUXx3yryUB+y8o9HD/AsuwSd 4BlUGR+pbuFqY4zL2zOuidLWwgjj2Ww0x5Je6zaubZi7GIvW2xUYld+MUJqMS9sb8XL6 8S85aCHG2L4dnNX3SisONYax00v8HhL4fVgnCq94BlJ9qgBfqTX7D6LG5ayckFWrPeae QtuZ4MzuppJL2hb5voghssL2a7HI4GIPdXrz0tuzBApab56+lEmWXniKVAQrJpb3Huwv k4ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qYDpdYyy; 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 o8-20020ac87c48000000b004181f36343fsi1898519qtv.775.2023.10.13.14.33.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:33:37 -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=qYDpdYyy; 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 1qrPmB-0001vq-QB; Fri, 13 Oct 2023 17:32:55 -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 1qrPm8-0001TF-7X for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:52 -0400 Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPm6-0001Xb-6D for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:51 -0400 Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6c7bbfb7a73so1610678a34.3 for ; Fri, 13 Oct 2023 14:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232769; x=1697837569; 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=0bSA2//wrqrp9x+dBDbiScNjiAckPEW5NolyefyLY70=; b=qYDpdYyyPlS06mURkFHcd6vzGLPffh3i+ejZ0oJiwwgS406hozRlWwX3tUkXKNotx+ g7O3vVMpIQYGKRsg2KTFw/xlVGZik3c4nhrtyIPG0fxDB31Ucwx4TJ2nSSEDqShOAIJy GnnMludsC/4tK85NLOPkp+rle74bBDqove9WOdLh+/o3c9YmBHn/8o+sKibkQ18fKd8C OTCLdLXXNmO/4bj3nOi8+pBgopBf1o3LLpYXBSc/hGr2tyVYvhMntDQIBkhggp91EMNL SX77brZtY5faOrRW6E1uGjcqIst2DVsB8GJWBmKESjQzt6kqspK9jg5DatV9HU745nWE 31iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232769; x=1697837569; 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=0bSA2//wrqrp9x+dBDbiScNjiAckPEW5NolyefyLY70=; b=NwalGAp1fFRpw6rhj3dlGUNv3JbhAQy54PlEhCQhM1qGre0WuqupQ4qSeT37hVVx1Y oHdqlfaTWdHgLz9qz9BYkS7s9UO99ROhFLPRJOHiNzLK4K19O6uHXRnpLI7V9Pd0HwqP 37DeyOw+0ATZWQjp6BS5/+r7VYIkwtrtAUZcnFKIJrkHnJN+sKNe8kKGfNT7oUlbBCOP 1vp1EEz71t+xCtyMGF4mvbzs44sgb1C+kjT8MGvEKFobBs1D4UVCpzSybhlr2tL8Vkpw HTx9L74pjrKwo2JV+6KkZFW4d+15lvJmw9lIC0k9IAqE8PL7LMlnnotSACDJ9fLBjzmb AAgg== X-Gm-Message-State: AOJu0YzwTFiDu0yXLIgEsl46zPolJk58ovOu+6b8SYJGOQoTN7rq9dEz wphMKDcuoojENyY2RNSyTaq55AkbJCt6lr5r2mU= X-Received: by 2002:a05:6830:1d94:b0:6bf:21d3:2de5 with SMTP id y20-20020a0568301d9400b006bf21d32de5mr29297347oti.17.1697232768999; Fri, 13 Oct 2023 14:32:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 66/85] target/sparc: Move gen_fop_DD insns to decodetree Date: Fri, 13 Oct 2023 14:28:27 -0700 Message-Id: <20231013212846.165724-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013212846.165724-1-richard.henderson@linaro.org> References: <20231013212846.165724-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32f; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32f.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 FSQRTd, FxTOd, FdTOx. Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 3 +++ target/sparc/translate.c | 50 +++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 5dd05bb211..d3badc6db3 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -240,6 +240,9 @@ 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 +FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @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 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bad929d2da..23b287cd38 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -55,6 +55,8 @@ #define gen_helper_restored ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fnegd ({ qemu_build_not_reached(); NULL; }) #define gen_helper_fabsd ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) +#define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) #define gen_helper_done(E) qemu_build_not_reached() #define gen_helper_retry(E) qemu_build_not_reached() #define gen_helper_udivx(D, E, A, B) qemu_build_not_reached() @@ -1538,20 +1540,6 @@ static void gen_fop_FFF(DisasContext *dc, int rd, int rs1, int rs2, gen_store_fpr_F(dc, rd, dst); } -static void gen_fop_DD(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64)) -{ - TCGv_i64 dst, src; - - src = gen_load_fpr_D(dc, rs); - dst = gen_dest_fpr_D(dc, rd); - - gen(dst, tcg_env, src); - gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); - - gen_store_fpr_D(dc, rd, dst); -} - static void gen_fop_DDD(DisasContext *dc, int rd, int rs1, int rs2, void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i64, TCGv_i64)) { @@ -4819,6 +4807,28 @@ TRANS(FABSd, 64, do_dd, a, gen_helper_fabsd) TRANS(FSRCd, VIS1, do_dd, a, tcg_gen_mov_i64) TRANS(FNOTd, VIS1, do_dd, a, tcg_gen_not_i64) +static bool do_env_dd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i64, TCGv_env, TCGv_i64)) +{ + TCGv_i64 dst, src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + gen_op_clear_ieee_excp_and_FTT(); + dst = gen_dest_fpr_D(dc, a->rd); + src = gen_load_fpr_D(dc, a->rs); + func(dst, tcg_env, src); + gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +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_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32)) { @@ -4961,10 +4971,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x29: /* fsqrts */ 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; + 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); @@ -5069,9 +5079,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x81: /* V9 fstox */ gen_fop_DF(dc, rd, rs2, gen_helper_fstox); break; - case 0x82: /* V9 fdtox */ - gen_fop_DD(dc, rd, rs2, gen_helper_fdtox); - break; case 0x83: /* V9 fqtox */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_fop_DQ(dc, rd, rs2, gen_helper_fqtox); @@ -5079,9 +5086,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x84: /* V9 fxtos */ gen_fop_FD(dc, rd, rs2, gen_helper_fxtos); break; - case 0x88: /* V9 fxtod */ - gen_fop_DD(dc, rd, rs2, gen_helper_fxtod); - break; case 0x8c: /* V9 fxtoq */ CHECK_FPU_FEATURE(dc, FLOAT128); gen_ne_fop_QD(dc, rd, rs2, gen_helper_fxtoq);