From patchwork Fri Oct 13 21:28:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733323 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1680179wrv; Fri, 13 Oct 2023 14:37:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/5BqnN+30BYAbPFzau320DPYvasLhJ06h+svarpeLe1V2wNN8v1QMtLxctr3KzqrpDQ9x X-Received: by 2002:a05:620a:e07:b0:773:c4c8:2d58 with SMTP id y7-20020a05620a0e0700b00773c4c82d58mr24447631qkm.59.1697233068985; Fri, 13 Oct 2023 14:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697233068; cv=none; d=google.com; s=arc-20160816; b=T4QjPULbvZwRzwWt+hqGN1bsDdJryxDLXgJ/QyMkJjexBVtTzvIrs05h2Bmes1VJdX 4dRjBV27AtwTpZ2oYj2IMa8Di8uyKRBJt99GofYw27cA9NZkkx3+Q7Gl1Fe2lTQAZMTW xEum2A1eRuRGiAdOfJps9AVm7teJUDvQSpvK94IvrS6fo3pRHf8sGQFQU7pmCRu5AbBS fverKhXeV3Gnsg0P156dIsZDyqHtryuoF2SHUt52D8R5WlN05C/70P5TIGLZII7oaFtU L8a3Z6Gzx1aMxea5B9Yax53waA1YCQ0QoAGl690aUJbwmzxQVWcfsXUIoE9JOd46I2ZV tyIw== 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=OOfC2T24jzV3tSPb2hgECBjIPhZHVxlVr0RgMAjSd8k=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=erMxpw5GkbsMRuUGev3DOZ7uVG6u/7xcGv3QuA+65vkeBKaKdZykopxeleZ2vm938v X8UvYt20JE/HCYdsH83leI0CB0wlp/OopArTtrK/BzcnitmiJ4djavHcIKitRGlYR2BV ABPlOwLkVPN4VDrK0k/IEoh9sYu1ozQ/a8pnr+0WAywKROOYnR7WwVKRdGghMdS6DpcX qi2gue5s6S41fkbRpnAzBle4HTDxnaiQhwcY5btK8l2hM8RsudGX9lGj1DkaGkwAnUN7 Cxb2X8usig4JxVBGbd50fAzt3mvG2HWr6RZFNUl65oIggeZmrOU5VRoJaOBJsL/wSpgt UbSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QP/1BAPt"; 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 i22-20020a05620a249600b00775a06ce4a5si1816656qkn.276.2023.10.13.14.37.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:37:48 -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="QP/1BAPt"; 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 1qrPm8-0001XV-OX; Fri, 13 Oct 2023 17:32:52 -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 1qrPm0-0000Sx-UO for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:45 -0400 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPly-0001SU-RQ for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:32:44 -0400 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3b2b1b03074so647038b6e.1 for ; Fri, 13 Oct 2023 14:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232761; x=1697837561; 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=OOfC2T24jzV3tSPb2hgECBjIPhZHVxlVr0RgMAjSd8k=; b=QP/1BAPt2zvWIPvAiOyHSxoJwM8FS5+a7y+s895IhfGUJrDjgCqJvSSlXS2ERCUqWm iIMeaDLVsrf9ASve4yF/bozaTGj3nbpib6zp9zux2HcGkXyLGONNK9ayasKTVJiZj1dv x6WDWxBV2sf5OIIp/po6KSRbb37ulkd0XXllBX0CFzgNRb5V9DMOsgAO204tk8rp2Rue LJsjHIE6IbWuajtWYtofwunFwzpzSH4hRzMxz+Wl3LBj8Q5flh0ROvIljwns06tm4rjA PTAz+ZcRUu/iR6h4Y+DR9Bvw5ItL/S9H/+DogCTcb/RZAyoVwigKwEhQQLVRXT3Y/aYj 8mGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232761; x=1697837561; 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=OOfC2T24jzV3tSPb2hgECBjIPhZHVxlVr0RgMAjSd8k=; b=iAZHXrBR3pphLSgZ+BDxDq55vkeb+XwXQ2M6n+gCLlyVZOwZbrsZd0GIVnFdew1DDW RERIVgQCRQiz3TkhxwCRVu2vzFkH3NXt3QJUBgC7yU+fBcbqw/vgvg2F1h7R3HkudSuV zenTGUbosfhvh7Ptdv25yGjXqbBAhhDHARLb+tUjnhWwDhAgV1i0ZbiXGZjuk+qOuk+7 PkRUM/xUNv4CQs5llrTA62r4UJiQtJQ6bJxe8fqaNHeauKTwIASXfVNVvC/T8tOM7rTu zJmezkqgP7XtsuqqDL9E1hSuiffW3s6TmYmXBxys57hP8NUn6yElG5+y6pICSHkhSuLO 5mHw== X-Gm-Message-State: AOJu0YzAiQhZkcRriAEPWKqB8N6FSKQCsn4b8KyqFG4+k4dNShsfcUlz q8AejbuGQtikSfFlG3Mb0vbBLT5Ce52bMXdz3bc= X-Received: by 2002:a05:6358:7246:b0:14a:e8af:1279 with SMTP id i6-20020a056358724600b0014ae8af1279mr29287069rwa.10.1697232761583; Fri, 13 Oct 2023 14:32:41 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id j5-20020aa78d05000000b0068842ebfd10sm13977191pfe.160.2023.10.13.14.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:32:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 58/85] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree Date: Fri, 13 Oct 2023 14:28:19 -0700 Message-Id: <20231013212846.165724-59-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::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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 | 13 ++++++++ target/sparc/translate.c | 64 ++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 1418e45172..2072930bd7 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -33,6 +33,10 @@ CALL 01 i:s30 &r_r_r rd rs1 rs2 @r_r_r .. rd:5 ...... rs1:5 . ........ rs2:5 &r_r_r +&r_r rd rs +@r_r1 .. rd:5 ...... rs:5 . ........ ..... &r_r +@r_r2 .. rd:5 ...... ..... . ........ rs:5 &r_r + Tcc_r 10 0 cond:4 111010 rs1:5 0 cc:1 0000000 rs2:5 Tcc_i 10 0 cond:4 111010 rs1:5 1 cc:1 0000 i:8 @@ -228,6 +232,10 @@ RESTORE 10 ..... 111101 ..... . ............. @r_r_ri DONE 10 00000 111110 00000 0 0000000000000 RETRY 10 00001 111110 00000 0 0000000000000 +FMOVs 10 ..... 110100 00000 0 0000 0001 ..... @r_r2 +FNEGs 10 ..... 110100 00000 0 0000 0101 ..... @r_r2 +FABSs 10 ..... 110100 00000 0 0000 1001 ..... @r_r2 + { [ EDGE8cc 10 ..... 110110 ..... 0 0000 0000 ..... @r_r_r @@ -251,6 +259,11 @@ RETRY 10 00001 111110 00000 0 0000000000000 ALIGNADDRL 10 ..... 110110 ..... 0 0001 1010 ..... @r_r_r BMASK 10 ..... 110110 ..... 0 0001 1001 ..... @r_r_r + + FSRCs 10 ..... 110110 ..... 0 0111 0101 00000 @r_r1 # FSRC1s + FSRCs 10 ..... 110110 00000 0 0111 1001 ..... @r_r2 # FSRC2s + FNOTs 10 ..... 110110 ..... 0 0110 1011 00000 @r_r1 # FNOT1s + FNOTs 10 ..... 110110 00000 0 0110 0111 ..... @r_r2 # FNOT2s ] NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 } diff --git a/target/sparc/translate.c b/target/sparc/translate.c index d0efe9f72b..c2fe193b6d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1481,19 +1481,6 @@ static void gen_fop_FF(DisasContext *dc, int rd, int rs, gen_store_fpr_F(dc, rd, dst); } -static void gen_ne_fop_FF(DisasContext *dc, int rd, int rs, - void (*gen)(TCGv_i32, TCGv_i32)) -{ - TCGv_i32 dst, src; - - src = gen_load_fpr_F(dc, rs); - dst = gen_dest_fpr_F(dc); - - gen(dst, src); - - 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)) { @@ -4823,6 +4810,27 @@ static bool do_stfsr(DisasContext *dc, arg_r_r_ri *a, MemOp mop) TRANS(STFSR, ALL, do_stfsr, a, MO_TEUL) TRANS(STXFSR, 64, do_stfsr, a, MO_TEUQ) +static bool do_ff(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_i32)) +{ + TCGv_i32 tmp; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + tmp = gen_load_fpr_F(dc, a->rs); + func(tmp, tmp); + gen_store_fpr_F(dc, a->rd, tmp); + return advance_pc(dc); +} + +TRANS(FMOVs, ALL, do_ff, a, tcg_gen_mov_i32) +TRANS(FNEGs, ALL, do_ff, a, gen_helper_fnegs) +TRANS(FABSs, ALL, do_ff, a, gen_helper_fabss) +TRANS(FSRCs, VIS1, do_ff, a, tcg_gen_mov_i32) +TRANS(FNOTs, VIS1, do_ff, a, tcg_gen_not_i32) + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -4864,15 +4872,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) switch (xop) { case 0x1: /* fmovs */ - cpu_src1_32 = gen_load_fpr_F(dc, rs2); - gen_store_fpr_F(dc, rd, cpu_src1_32); - break; case 0x5: /* fnegs */ - gen_ne_fop_FF(dc, rd, rs2, gen_helper_fnegs); - break; case 0x9: /* fabss */ - gen_ne_fop_FF(dc, rd, rs2, gen_helper_fabss); - break; + g_assert_not_reached(); /* in decodetree */ case 0x29: /* fsqrts */ gen_fop_FF(dc, rd, rs2, gen_helper_fsqrts); break; @@ -5200,6 +5202,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x018: /* VIS I alignaddr */ case 0x01a: /* VIS I alignaddrl */ case 0x019: /* VIS II bmask */ + case 0x067: /* VIS I fnot2s */ + case 0x06b: /* VIS I fnot1s */ + case 0x075: /* VIS I fsrc1s */ + case 0x079: /* VIS I fsrc2s */ g_assert_not_reached(); /* in decodetree */ case 0x020: /* VIS I fcmple16 */ CHECK_FPU_FEATURE(dc, VIS1); @@ -5387,10 +5393,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DD(dc, rd, rs2, tcg_gen_not_i64); break; - case 0x067: /* VIS I fnot2s */ - CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_FF(dc, rd, rs2, tcg_gen_not_i32); - break; case 0x068: /* VIS I fandnot1 */ CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DDD(dc, rd, rs2, rs1, tcg_gen_andc_i64); @@ -5403,10 +5405,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DD(dc, rd, rs1, tcg_gen_not_i64); break; - case 0x06b: /* VIS I fnot1s */ - CHECK_FPU_FEATURE(dc, VIS1); - gen_ne_fop_FF(dc, rd, rs1, tcg_gen_not_i32); - break; case 0x06c: /* VIS I fxor */ CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_xor_i64); @@ -5444,11 +5442,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) cpu_src1_64 = gen_load_fpr_D(dc, rs1); gen_store_fpr_D(dc, rd, cpu_src1_64); break; - case 0x075: /* VIS I fsrc1s */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_32 = gen_load_fpr_F(dc, rs1); - gen_store_fpr_F(dc, rd, cpu_src1_32); - break; case 0x076: /* VIS I fornot2 */ CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DDD(dc, rd, rs1, rs2, tcg_gen_orc_i64); @@ -5462,11 +5455,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) cpu_src1_64 = gen_load_fpr_D(dc, rs2); gen_store_fpr_D(dc, rd, cpu_src1_64); break; - case 0x079: /* VIS I fsrc2s */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_32 = gen_load_fpr_F(dc, rs2); - gen_store_fpr_F(dc, rd, cpu_src1_32); - break; case 0x07a: /* VIS I fornot1 */ CHECK_FPU_FEATURE(dc, VIS1); gen_ne_fop_DDD(dc, rd, rs2, rs1, tcg_gen_orc_i64);