From patchwork Thu Oct 26 00:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738259 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp557626wrq; Wed, 25 Oct 2023 17:33:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtAeCI5Ic32aHv0PhF6tZ+nupjRtDsMBaNguIZqEZenzaSnS1KxLMlfJZz70zI9D4c23Qt X-Received: by 2002:a05:600c:488a:b0:408:369a:dad1 with SMTP id j10-20020a05600c488a00b00408369adad1mr1222198wmp.4.1698280418563; Wed, 25 Oct 2023 17:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280418; cv=none; d=google.com; s=arc-20160816; b=K2yTA31Zk/xAsm+td/RVJW7qOVu/6QynMCh7s+THmehnoLObqIO5t1MJfjl7HpEd/z ZwwX1p9U8IsL2Zy0vmWbgqc/NzUEbCNj4r348NIKFwoCsVnN6Gi/mGuVtcgQhs1EQbqa E1DJkocwF1Ld5+v1kuzWWcj0Te+NL1LohYKo5W5pdsd4zxE4k6WL5c55WGXGyMEU92kN mMomIisUzzmngeOXdPCQRH1fDOqrqiCQvRZG796dLdJ+U9f6kBRqs9Q6hzhKeO5gxORh CN9ITG+uYTABKuCn5agpu8lLHAZky2T4Zr+DMPxXqROpIOByOdu3CFud4eLshWz5QGe/ UeSQ== 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=TQF3etiI8esxPvJgRU7maR5kYUtpFP3hIg8XqhuROnM=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=V0e9Hh+3VAQk3mAPmI4VuhISu6SXCAdJ12ymr/epI7ppe3AXlls6yowZABdfJevK5G llWAghSkWueTZuvVZqbyYk5jb0EMylowBaY888YMBKIOsDH1rgRkx9XzaKtIl72DiOS3 6DYIuq3v71DGPmNW8XosL6hJkF1K/dSPeXbPf7AJ1ktqLpq5/tqXJf/jL82lSZoMKNKQ pA7ysDCW6CuuHXVZsBcESnSm58+u36t6XGPW10HV03ApQZ3KyxTy01eJz1KcQx9hR4Eo lm22vllqmkAMixn45oLi81zZ6grfZrujt4s/zce+f2OAbcHmdoi6x0hLgqeEB+U697EK XVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NB6BpZhn; 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 n11-20020a5d400b000000b0032da480825fsi8202589wrp.466.2023.10.25.17.33.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:33:38 -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=NB6BpZhn; 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 1qvoCj-0003io-TL; Wed, 25 Oct 2023 20:26:30 -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 1qvoCf-0003bX-Vs for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:26:26 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvoCe-0000Zn-5y for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:26:25 -0400 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5b856d73a12so301590a12.1 for ; Wed, 25 Oct 2023 17:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279982; x=1698884782; 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=TQF3etiI8esxPvJgRU7maR5kYUtpFP3hIg8XqhuROnM=; b=NB6BpZhnyT4ljfbyrFS1szRwoQScY6lDcDvRuabPfrOhznxhNPtd8XmKJB1uQBx0wG Id7EpL2bbvUmE3Q4QgcL8Yv670axoSfRIXdxRyERPRGDKOHEWayNoRZZ0CpmnAzs/41w Cxg9FnPh+RJjlmSdFri7JqajyRMPWOzBHbCoUZd2b0kBcYPDCAk9ZWLG4BZGjEldSfod NAcCyi8c3cv+/a9Uux+8wJS/H5ihZR7K1f0iu5DoOglmsenMbJyTz6qaoSIc3L6r7Nwb E7s3Q9DliiTKOMJKbu7T7Ku7ZyII1MkdHYOaDrtu6cXLyCFzOYykv2U1B3PC4Scj8Mjs GQGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279982; x=1698884782; 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=TQF3etiI8esxPvJgRU7maR5kYUtpFP3hIg8XqhuROnM=; b=A+PovdGxOROni3YQF1taVdPhzQOacRHhiJKRiwDQVGl/Q7veP2dzG5L4cZnkvB3AxC lvkaWkLb9kJVRwD//f9dCu/0bxO/k5RokCuWI2wCA7zvnw/8hssLz2C+FzYHIPrLT3Mn ofvYuy0HUY0ZxRQLuOHvrI9el8Ir/kzJP2GsQ98pLSkI/SRBRXj7UO4habcznn4yzZH/ RZzvQSwVC/s2sgXWdmUN3kANxlv7kAglhxt1ibgPgNhBwGgowkNadiNW5Or+EYM20yy/ 84dTzQTWmMHN4xBbuY5WBZN+ypFUaPNXhbXcJcehQ8Ekjb+cYV9dwu0dPbv9wD5x5SJ2 P8OA== X-Gm-Message-State: AOJu0YxvDPI9X4AWeI+WCv68LW6U78NJLbmaPIb8PGtKq0FWgmDWpL/B WOQlB4Af5jykURGp4E8ll7gXAjo00nX2wi/GjHw= X-Received: by 2002:a17:90b:3812:b0:27d:3f08:cc21 with SMTP id mq18-20020a17090b381200b0027d3f08cc21mr17856206pjb.5.1698279982626; Wed, 25 Oct 2023 17:26:22 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id gv24-20020a17090b11d800b00262ca945cecsm438134pjb.54.2023.10.25.17.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:26:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 92/94] target/sparc: Move FPACK16, FPACKFIX to decodetree Date: Wed, 25 Oct 2023 17:15:40 -0700 Message-Id: <20231026001542.1141412-122-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 2 ++ target/sparc/translate.c | 55 ++++++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 781c3cd7f7..18a840709f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -344,6 +344,8 @@ FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 FMULD8SUx16 10 ..... 110110 ..... 0 0011 1000 ..... @r_r_r FMULD8ULx16 10 ..... 110110 ..... 0 0011 1001 ..... @r_r_r FPACK32 10 ..... 110110 ..... 0 0011 1010 ..... @r_r_r + FPACK16 10 ..... 110110 00000 0 0011 1011 ..... @r_r2 + FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @r_r2 PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @r_r_r FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @r_r_r diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 3ee1015cc4..15c91c6caa 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -756,6 +756,24 @@ static void gen_op_array32(TCGv dst, TCGv src1, TCGv src2) tcg_gen_shli_tl(dst, dst, 2); } +static void gen_op_fpack16(TCGv_i32 dst, TCGv_i64 src) +{ +#ifdef TARGET_SPARC64 + gen_helper_fpack16(dst, cpu_gsr, src); +#else + g_assert_not_reached(); +#endif +} + +static void gen_op_fpackfix(TCGv_i32 dst, TCGv_i64 src) +{ +#ifdef TARGET_SPARC64 + gen_helper_fpackfix(dst, cpu_gsr, src); +#else + g_assert_not_reached(); +#endif +} + static void gen_op_fpack32(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) { #ifdef TARGET_SPARC64 @@ -4589,6 +4607,26 @@ 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_fd(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i32, TCGv_i64)) +{ + TCGv_i32 dst; + TCGv_i64 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = gen_dest_fpr_F(dc); + src = gen_load_fpr_D(dc, a->rs); + func(dst, src); + gen_store_fpr_F(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FPACK16, VIS1, do_fd, a, gen_op_fpack16) +TRANS(FPACKFIX, VIS1, do_fd, a, gen_op_fpackfix) + static bool do_env_ff(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i32, TCGv_env, TCGv_i32)) { @@ -5265,10 +5303,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) } else if (xop == 0x36) { #ifdef TARGET_SPARC64 /* VIS */ - TCGv_i64 cpu_src1_64, cpu_dst_64; + TCGv_i64 cpu_dst_64; TCGv_i32 cpu_dst_32; int opf = GET_FIELD_SP(insn, 5, 13); - int rs2 = GET_FIELD(insn, 27, 31); int rd = GET_FIELD(insn, 2, 6); if (gen_trap_ifnofpu(dc)) { @@ -5351,21 +5388,9 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) case 0x02a: /* VIS I fcmpeq16 */ case 0x02c: /* VIS I fcmpgt32 */ case 0x02e: /* VIS I fcmpeq32 */ - g_assert_not_reached(); /* in decodetree */ case 0x03b: /* VIS I fpack16 */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_64 = gen_load_fpr_D(dc, rs2); - cpu_dst_32 = gen_dest_fpr_F(dc); - gen_helper_fpack16(cpu_dst_32, cpu_gsr, cpu_src1_64); - gen_store_fpr_F(dc, rd, cpu_dst_32); - break; case 0x03d: /* VIS I fpackfix */ - CHECK_FPU_FEATURE(dc, VIS1); - cpu_src1_64 = gen_load_fpr_D(dc, rs2); - cpu_dst_32 = gen_dest_fpr_F(dc); - gen_helper_fpackfix(cpu_dst_32, cpu_gsr, cpu_src1_64); - gen_store_fpr_F(dc, rd, cpu_dst_32); - break; + g_assert_not_reached(); /* in decodetree */ case 0x060: /* VIS I fzero */ CHECK_FPU_FEATURE(dc, VIS1); cpu_dst_64 = gen_dest_fpr_D(dc, rd);