From patchwork Sat Oct 21 05:31:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736674 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp634957wrl; Fri, 20 Oct 2023 22:47:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTNXi8igkThT4mFmQYMm3N7HGcSf2WDsgbSoG5YXvT8j0hHIa8W/xiosRP/wWARgoOv0cq X-Received: by 2002:a05:622a:304:b0:412:2ad4:da05 with SMTP id q4-20020a05622a030400b004122ad4da05mr4145605qtw.38.1697867255029; Fri, 20 Oct 2023 22:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697867255; cv=none; d=google.com; s=arc-20160816; b=WNFZ0akwRrSe/byKcwnMxqtt+Cz6R/T83tY3xLjsWBQx7+PUtI8ABcBQBTrBqKrEv1 zXnNm1lwvR38nDXGU8h+OLi+mYOOIvnU0xU9DKWzDA9KFx3vsDkBP1XvQuLLa5vNTuY9 7KgHu7HmFYpvGuZ5MR6VU9EhWnyaWBHiWCYG1BzB5cW+U7EfHqFGtJG1Q39h5In1YgOI 024y/WbHMw1LnTQ5A5Bgyzfgl1p4SmHx1oE2aIFv0019ztibHoeF1HVibuRE+xvkkqz4 UXjDoEMMyeE+lZ5fSjbUrHSh3vDQ50aAWs+iG7+dEnHNA3ckxwEkZZRoekV9NVcfaDCV i1wA== 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=foC8PXJXHiVmCLdzU9Kncpr4frxu6s3Go8QawovY8VU=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=eq0n2Eu+6JjpJxKZHVkQTXwsY/UsUffKg40tOxZW2V7jvNQmszIAzEUaBoVHtCAT4S GpOCeu4yAze7E2UNdFwnCRMcqWnuYGf8nRGwIZCtLpoYcqZHqYxOMV//vCGJJs06FIo7 Ety8eopRDULN/FNyshEqTSLhO1YxCy7Rm+vgL3VUToxIoK6vgDpv2KD7UA2Rcpmj+MKB MAe2CD5zBR1B6oY3DdqEnmZ7o9Qbl5IzMes4Z9maMosMyjzDzbdc44bCHxYDyX612ZUd NBMQxAzDRuhM46Rpzkzmq3SX9HKB5cpSfFkzOldrvLZ1xzIUmHyCDbmq8rO0ijnk4Fid QQCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bNqLZ1KM; 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 n14-20020a05622a040e00b00419856ea1casi2414338qtx.123.2023.10.20.22.47.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 22:47:35 -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=bNqLZ1KM; 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 1qu4bL-0007Lg-Et; Sat, 21 Oct 2023 01:32:43 -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 1qu4b7-0007FN-UG for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:32:32 -0400 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qu4b5-0008Sf-CP for qemu-devel@nongnu.org; Sat, 21 Oct 2023 01:32:29 -0400 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3af604c3f8fso1115558b6e.1 for ; Fri, 20 Oct 2023 22:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697866346; x=1698471146; 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=foC8PXJXHiVmCLdzU9Kncpr4frxu6s3Go8QawovY8VU=; b=bNqLZ1KM9gmaU422Z8/PVRnEK0MBAm48wHn2oJiwScyXIRtmUMc8T30QqHmzfySkqL qWRMROFObh/Ni0pNJYj6UP3l9FJCO3vur+inPDlLcR/VgzglSbzmrHgLuSd2tyG2dPNE umo89vqgQmrMtBL9F2yrKIOhKm4r93CghwBnGVyxklmIYXBiO7l+LOLJwn6Nqk6c9GJR UT/CfqfV6D4itPjviA0lmP0DE38a3JJGNUNpJbwmQmy+UHmvEcnocfHu9GmcgiQdLD1j D/CmjVaC3WB1vr2r0ajqzfcJsjORop9WP3NUzY+15Sx7zzdOtAfXhSPP6rBCbitzlVRE kjmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697866346; x=1698471146; 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=foC8PXJXHiVmCLdzU9Kncpr4frxu6s3Go8QawovY8VU=; b=XRARgp7c4bZahEUz1HJE7dmGOn5eWYlBI+UjL0FYgl5SOOYtRpy6oxrwvWZ3Ri2lAj xP2+O6fgX913aFGSoITFC3J5qj8pcnAalRB/3VSwqYu1JlzmApmd9IcG3A9/6u9UHBZl 7pR7ZIBx21oHRfoViWS9o2g57IieLwJMpN668Qi/OilnIvshv8SpbVCaq5lhIHZBo1ZC lfDRxds2pFnWpUeL9utbsYqGex/GE/RzEgnvkisErVLZgK6wWTmzN77so9+LMD16Limr pB63zWeOqJjWShk/ZihhKRkTD1m590kTTdAs3ploNwklVqciR64du2xRaf2I3XZpaBfA nG5A== X-Gm-Message-State: AOJu0YxVfLTKott80axBXHXSfk2pPHOsrJfkLHm722IgHDe28q2pTT6n btp3WyEnn6BP4OW8DDE+U9e0rxbhnsEU/iejng0= X-Received: by 2002:a54:4e8c:0:b0:3b2:e624:43a0 with SMTP id c12-20020a544e8c000000b003b2e62443a0mr4204559oiy.15.1697866346206; Fri, 20 Oct 2023 22:32:26 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id f20-20020a056a001ad400b006b2677d3684sm2434831pfv.206.2023.10.20.22.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 22:32:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 32/90] target/sparc: Move UMUL, SMUL to decodetree Date: Fri, 20 Oct 2023 22:31:00 -0700 Message-Id: <20231021053158.278135-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231021053158.278135-1-richard.henderson@linaro.org> References: <20231021053158.278135-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.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 | 2 ++ target/sparc/translate.c | 21 +++------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 694d2c3648..f214baf465 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -167,6 +167,8 @@ XORN 10 ..... 0.0111 ..... . ............. @r_r_ri_cc ADDC 10 ..... 0.1000 ..... . ............. @r_r_ri_cc MULX 10 ..... 001001 ..... . ............. @r_r_ri_cc0 +UMUL 10 ..... 0.1010 ..... . ............. @r_r_ri_cc +SMUL 10 ..... 0.1011 ..... . ............. @r_r_ri_cc Tcc_r 10 0 cond:4 111010 rs1:5 0 cc:1 0000000 rs2:5 { diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 4ce87f59b9..4744e8caca 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2882,6 +2882,7 @@ static void gen_faligndata(TCGv dst, TCGv gsr, TCGv s1, TCGv s2) #define avail_ASR17(C) ((C)->def->features & CPU_FEATURE_ASR17) #define avail_GL(C) ((C)->def->features & CPU_FEATURE_GL) #define avail_HYPV(C) ((C)->def->features & CPU_FEATURE_HYPV) +#define avail_MUL(C) ((C)->def->features & CPU_FEATURE_MUL) #define avail_POWERDOWN(C) ((C)->def->features & CPU_FEATURE_POWERDOWN) /* Default case for non jump instructions. */ @@ -4170,6 +4171,8 @@ TRANS(ANDN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_andc_tl, NULL) TRANS(ORN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_orc_tl, NULL) TRANS(XORN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_eqv_tl, NULL) TRANS(MULX, 64, do_arith, a, 0, tcg_gen_mul_tl, tcg_gen_muli_tl) +TRANS(UMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_umul, NULL) +TRANS(SMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_smul, NULL) static bool trans_OR(DisasContext *dc, arg_r_r_ri_cc *a) { @@ -4660,24 +4663,6 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) cpu_src1 = get_src1(dc, insn); cpu_src2 = get_src2(dc, insn); switch (xop & ~0x10) { - case 0xa: /* umul */ - CHECK_IU_FEATURE(dc, MUL); - gen_op_umul(cpu_dst, cpu_src1, cpu_src2); - if (xop & 0x10) { - tcg_gen_mov_tl(cpu_cc_dst, cpu_dst); - tcg_gen_movi_i32(cpu_cc_op, CC_OP_LOGIC); - dc->cc_op = CC_OP_LOGIC; - } - break; - case 0xb: /* smul */ - CHECK_IU_FEATURE(dc, MUL); - gen_op_smul(cpu_dst, cpu_src1, cpu_src2); - if (xop & 0x10) { - tcg_gen_mov_tl(cpu_cc_dst, cpu_dst); - tcg_gen_movi_i32(cpu_cc_op, CC_OP_LOGIC); - dc->cc_op = CC_OP_LOGIC; - } - break; case 0xc: /* subx, V9 subc */ gen_op_subx_int(dc, cpu_dst, cpu_src1, cpu_src2, (xop & 0x10));