From nobody Tue Feb 10 10:20:46 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1598891074; cv=none; d=zohomail.com; s=zohoarc; b=LojdwJnvFaKtgqNyEN3BZC6ZqYMhJC5KoplxkALahffqs5t8gHJGs6VPdRZYwMmDxNAebaQQK8C5XcHRNACJbWkhzPVRbWibjcWkrAMQFCy+wD4Y4s5kI/9SkvkLuN3WLygBVAhQ40iwmrUx5CXJuheiv9AJAoIdzHzP0rUhnxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598891074; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rWOc9BwUZsVi//eDSn3YgBVyZRgNAuFh68+VKq4fp/Q=; b=R9rchMm9IIZmeDjc4r3hSCrDUqxnuWdi/ftmTHQfe0Z9d4XcuaQxscNcz7Obs/gycda8QYPQeAwe0OXobCiV2DCNNG1jIEidcFkpDYT2vm0+WXkKjKZyzGpsTARCg94PnzmrW2fo3iqPf9bn9+nc06vurLSlK0/p3mJrpFxgSrU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1598891074517136.85473445204047; Mon, 31 Aug 2020 09:24:34 -0700 (PDT) Received: from localhost ([::1]:33156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmbh-0008Eo-PO for importer@patchew.org; Mon, 31 Aug 2020 12:24:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmKn-0005JQ-Ci for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:05 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:40973) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmKk-00063n-Mm for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:05 -0400 Received: by mail-pf1-x42a.google.com with SMTP id t9so805511pfq.8 for ; Mon, 31 Aug 2020 09:07:02 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rWOc9BwUZsVi//eDSn3YgBVyZRgNAuFh68+VKq4fp/Q=; b=LD+/DsM68XC5buvs7Xbjn9dT4H3XqujGlPzBqjCCljAsvMWOlBzBtxKiJblJV9bxeb DHu9OneExkDDpo7P6UzWJ1a6b3gN5Z5S4GmicVGazw9yPeRqkWxG9qeF+VcO5vBMSwSH smoQ2+vknkB6VcVaW3twQTzocKwZk34FeHXGs/5pd9OijKBT08ge+J7wyqwW9L91la9i YklEKvbhbCku64qbemYdcSmAJMF8AVDCSXNtUHRnmHF2Bqzw7MUAdC9QP8bD9xy4Dl2U ufA+UYNv+q2j6FSdPCU7doAmD6n1NbCQhColaZI4Z+1ARmrcFv51kYJwyJZ+FE4NuC1m 2Svg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rWOc9BwUZsVi//eDSn3YgBVyZRgNAuFh68+VKq4fp/Q=; b=fiBi9AmD5s7dtm4rGthFvHhYFhD8umDZ7EyyNWgrhBAay2/JCWtIRru55osHMIX4IW wEPX8ybsnVXkN8m3BOZxNfKH9swR9oajPxE44UKPUuhUAh/QsEEqcaeiSjoUxa/KOcaA TEXgJkK/ZYwiH1eoQcNqrtmXpLEfQJzvE09+Yp8it1dCSuIMxiuTWwUFh2iGHnhMI5nw nZLIKVH5sXkaoVOhmUwueCARZpkrtp9QdA3z1vIc7W1ff3PGy4afG4y0mx7OgIXi3/Aa ETBkZgzQeqTUDTDwc+Ue0/4cEIS2FfFW5Uep0arkb+SUHD0l4waLuHNDnI6MpRQ4U4Js xFlA== X-Gm-Message-State: AOAM530gSuqxKJnyFD2Szs5v1WAC81C5XRnTXvDjxSElH9BkLMi9i60c JuBQ7UXt+S1d+nSIC2MfnrYQEJPA5Ntpig== X-Google-Smtp-Source: ABdhPJxn3G7rL/Mvq5vfAM+WLA+6aQ3OSmJd6YS3qazc7FSu3UvMH59KeTZIiJZMs4YKKOEDWIlEFw== X-Received: by 2002:a63:4b61:: with SMTP id k33mr1708075pgl.195.1598890020925; Mon, 31 Aug 2020 09:07:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 42/76] target/microblaze: Convert dec_div to decodetree Date: Mon, 31 Aug 2020 09:05:27 -0700 Message-Id: <20200831160601.833692-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831160601.833692-1-richard.henderson@linaro.org> References: <20200831160601.833692-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/insns.decode | 3 +++ target/microblaze/translate.c | 35 +++++++++++++--------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/target/microblaze/insns.decode b/target/microblaze/insns.decode index 1a2e22e44a..b2dcbdf784 100644 --- a/target/microblaze/insns.decode +++ b/target/microblaze/insns.decode @@ -50,6 +50,9 @@ andni 101011 ..... ..... ................ @= typeb cmp 000101 ..... ..... ..... 000 0000 0001 @typea cmpu 000101 ..... ..... ..... 000 0000 0011 @typea =20 +idiv 010010 ..... ..... ..... 000 0000 0000 @typea +idivu 010010 ..... ..... ..... 000 0000 0010 @typea + mul 010000 ..... ..... ..... 000 0000 0000 @typea mulh 010000 ..... ..... ..... 000 0000 0001 @typea mulhu 010000 ..... ..... ..... 000 0000 0011 @typea diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 617e208583..9763b9d77c 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -368,6 +368,19 @@ static void gen_cmpu(TCGv_i32 out, TCGv_i32 ina, TCGv_= i32 inb) DO_TYPEA(cmp, false, gen_cmp) DO_TYPEA(cmpu, false, gen_cmpu) =20 +static void gen_idiv(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) +{ + gen_helper_divs(out, cpu_env, inb, ina); +} + +static void gen_idivu(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) +{ + gen_helper_divu(out, cpu_env, inb, ina); +} + +DO_TYPEA_CFG(idiv, use_div, true, gen_idiv) +DO_TYPEA_CFG(idivu, use_div, true, gen_idivu) + static void gen_mulh(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) { TCGv_i32 tmp =3D tcg_temp_new_i32(); @@ -683,27 +696,6 @@ static void dec_msr(DisasContext *dc) } } =20 -/* Div unit. */ -static void dec_div(DisasContext *dc) -{ - unsigned int u; - - u =3D dc->imm & 2;=20 - - if (trap_illegal(dc, !dc->cpu->cfg.use_div)) { - return; - } - - if (u) - gen_helper_divu(cpu_R[dc->rd], cpu_env, *(dec_alu_op_b(dc)), - cpu_R[dc->ra]); - else - gen_helper_divs(cpu_R[dc->rd], cpu_env, *(dec_alu_op_b(dc)), - cpu_R[dc->ra]); - if (!dc->rd) - tcg_gen_movi_i32(cpu_R[dc->rd], 0); -} - static void dec_barrel(DisasContext *dc) { TCGv_i32 t0; @@ -1565,7 +1557,6 @@ static struct decoder_info { {DEC_BCC, dec_bcc}, {DEC_RTS, dec_rts}, {DEC_FPU, dec_fpu}, - {DEC_DIV, dec_div}, {DEC_MSR, dec_msr}, {DEC_STREAM, dec_stream}, {{0, 0}, dec_null} --=20 2.25.1