From patchwork Thu Oct 26 00:14:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738283 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp559299wrq; Wed, 25 Oct 2023 17:38:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF94oAIVbdXZKadGAADe+Qn6Q+6yGy83PdnQk90xgu/15jbUEquGR6NUFrVWxVg/J+rNJ0i X-Received: by 2002:adf:f9cd:0:b0:32d:825d:f153 with SMTP id w13-20020adff9cd000000b0032d825df153mr12754734wrr.61.1698280732190; Wed, 25 Oct 2023 17:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280732; cv=none; d=google.com; s=arc-20160816; b=Yd06n51Tar0szeLzbFk2D8GQ1lsCD+6jXKGEASYOedDfBZqIDfTEyvCzpi63nzZNCh miztlpy94te7HrG9o5IR42dcDFjkEf/7XfRbzJIV5tWCa07vCd9Ivak3EhlCdp2RPeU/ anQXnMockCxRWq10pcJaQCCd+tl7zv4Pc40iOheVuRE+OwqhEwPmm6UPJALBMAV1TnHv uFFtYegnsUAuNurKDkUri/kmtz8i73yrUewxZc4BMBev+07J2dt6TzH7A5+uXgzORTo2 bwHhGVtCY29xT4/te34Q3M24rt8Tl4A438VdxDvqB7Itf7zWpabtaq049QHLSto4uOWD KFEQ== 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=72s8HqffwPu4WrB9To1B78GgLRzIoL8cOwTuhEiKsh4=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=sMG3rJOLEZ2VLwZs4YGhSqV4cETKtnViH/NxiNs426UDVcY9jovesqWBwvOM9RDCrJ YKmQC1U+x5CHl40Dvxt/BUJ4j1Jrn0kQzmetFHep1U7KQAK1W8lXZ1K15lney+1yOr21 Jgs8Avr7K+kv5gcdohOq2axdERLC8fjJaHinwuFHR4T1DC+mz8XFah6fhK46S4/b30o7 gsompq4at1iMu9afPU2Ia+oMl21zS6eDMuwTggmjRbnZYikgSdsj/XTL4bpGBCygoyij 3+JS7CEHab20UxyPuBpXqbx3UBRzq0dR2gG6hj78glj2VegsqyyxXW8NNj84ImvDm+5q RG2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=osrR7jiK; 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 k14-20020a056000004e00b0032d83568f47si8201037wrx.457.2023.10.25.17.38.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:38:52 -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=osrR7jiK; 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 1qvo6n-0002Fl-9C; Wed, 25 Oct 2023 20:20:21 -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 1qvo6I-0001Ew-1Z for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:50 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo68-0006eQ-Ak for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:49 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ca215cc713so2036785ad.3 for ; Wed, 25 Oct 2023 17:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279578; x=1698884378; 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=72s8HqffwPu4WrB9To1B78GgLRzIoL8cOwTuhEiKsh4=; b=osrR7jiK8VV9mAwnptytgb4SAqhjEs+j/8TP1PK3YSuShfBdc5VXCXP6D4uzUBHfDn 9Hpq68g3OhgqkOkdryYslmQ1/JArXIhnuF+hzDW/ZLCvewPcHJkUi5cyrjCdIbM3mqKF ug1IBbz0iLV8hf8gafSAhrG9cNULcQc0acH+UaeX2+3RMILU9rrweYRxUgAEXYnEObRm PVma5X6clsZJL4tbMUecfS6rDrtjt8A5hwfXTk6/9K7Dreaa8vnueKLMDBVucyEdBNzH YD+B/Jd2qGL+U9l+WSgavi4htJbuXrzpgijnxkLDrdOokR2g4/wVJpuqBSLluSDVoTpN LJvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279578; x=1698884378; 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=72s8HqffwPu4WrB9To1B78GgLRzIoL8cOwTuhEiKsh4=; b=RxTvuwZTaP6q9IrDLUo491TZZddewvCrQhXYABcGDhiQD9f6OSz8PCSLvzR5aIGb7o S6bxOA2pgnWS+lGAwkJvCRDVExvo3HJIuUq5V3l095d2WhINbk1vamsRig/z1Ifl8vw1 yIW8hJns8zh0hP5Mkb028GFx6D1Aji5uc1+d+7zM6mpdEk2oV+G7jVEyUPO42AoeX+uI iSF3ht9QukgCBZkYc7u4p/UMaw1IuRvKobvSbX7t8LV96uU+s14Zd6sAefjfTx2A5MAo sKjCKNqLEJsmFnLINMJKlLtj697DofFr4cuTg2gDQa5dEmg2Eck3Lmx2xSjfJDsSP7SQ uXgw== X-Gm-Message-State: AOJu0Yz1A15HQETcsCCa6HhusAliqVKb04GP6FR1JOnJeEV7JyktJWqp 8BSpupmUdhK7qalGKjCjaepxQsp4gY33UWkGELk= X-Received: by 2002:a17:902:db0b:b0:1ca:79b6:ce42 with SMTP id m11-20020a170902db0b00b001ca79b6ce42mr14636107plx.47.1698279577829; Wed, 25 Oct 2023 17:19:37 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c5fc291ef9sm9754655plb.209.2023.10.25.17.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:19:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 36/94] target/sparc: Move UMUL, SMUL to decodetree Date: Wed, 25 Oct 2023 17:14:44 -0700 Message-Id: <20231026001542.1141412-66-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::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 | 22 ++++------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 1a04a8e229..d6a7256e71 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 2ecd9edb33..e7c3c68402 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2888,6 +2888,7 @@ static void gen_faligndata(TCGv dst, TCGv gsr, TCGv s1, TCGv s2) #ifdef TARGET_SPARC64 # define avail_32(C) false # define avail_ASR17(C) false +# define avail_MUL(C) true # define avail_POWERDOWN(C) false # define avail_64(C) true # define avail_GL(C) ((C)->def->features & CPU_FEATURE_GL) @@ -2895,6 +2896,7 @@ static void gen_faligndata(TCGv dst, TCGv gsr, TCGv s1, TCGv s2) #else # define avail_32(C) true # define avail_ASR17(C) ((C)->def->features & CPU_FEATURE_ASR17) +# define avail_MUL(C) ((C)->def->features & CPU_FEATURE_MUL) # define avail_POWERDOWN(C) ((C)->def->features & CPU_FEATURE_POWERDOWN) # define avail_64(C) false # define avail_GL(C) false @@ -4098,6 +4100,8 @@ TRANS(ORN, ALL, do_logic, a, tcg_gen_orc_tl, NULL) TRANS(XORN, ALL, do_logic, a, tcg_gen_eqv_tl, NULL) TRANS(MULX, 64, do_arith, a, -1, tcg_gen_mul_tl, tcg_gen_muli_tl, NULL) +TRANS(UMUL, MUL, do_logic, a, gen_op_umul, NULL) +TRANS(SMUL, MUL, do_logic, a, gen_op_smul, NULL) static bool trans_OR(DisasContext *dc, arg_r_r_ri_cc *a) { @@ -4564,24 +4568,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));