From patchwork Tue Jul 4 09:54:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 9824465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DAEB7602F0 for ; Tue, 4 Jul 2017 09:59:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CACA728464 for ; Tue, 4 Jul 2017 09:59:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF67E28497; Tue, 4 Jul 2017 09:59:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D64B28464 for ; Tue, 4 Jul 2017 09:59:34 +0000 (UTC) Received: from localhost ([::1]:40032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSKcH-0005NV-2p for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Jul 2017 05:59:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSKXr-00024C-LX for qemu-devel@nongnu.org; Tue, 04 Jul 2017 05:55:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSKXq-0000YF-LG for qemu-devel@nongnu.org; Tue, 04 Jul 2017 05:54:59 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:33144) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSKXq-0000Xi-EL for qemu-devel@nongnu.org; Tue, 04 Jul 2017 05:54:58 -0400 Received: by mail-lf0-x242.google.com with SMTP id t72so17250686lff.0 for ; Tue, 04 Jul 2017 02:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xs2kYA4ICPjEHediD5stfUmYr8t+e5E1uof4BVm28GY=; b=ZzLk6M8pSSWqxBddynnEca1UynHmcgN0iGowIVYZGoAT6MggJQFKjavdOYJEQ1UYKy s6cVo3/ASqKQ09uc1hDvR0N2FkcG7tFIjKzcet+XDqMH1eSwsi1aaywbNA+IbnFwGF71 EG6wQHwz9+5JaCffRjBDYUSjpzFklJP8OE+w+/81tgVAz1T3V1qARIUMdQmpXPMTtt2m U2LU4sKdwhx/Xm54nCM+7jFkkzMeDS7Pggak5bW2+K9BaRSs4p+gYOR+eunB+1RShzBI kAFga+KWLFayQnYDhMRKCItuyJeBwKR0z/6+e1+BuyEHTWZ5xJIgEdilE8euk+tLs4ul sOuQ== 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; bh=Xs2kYA4ICPjEHediD5stfUmYr8t+e5E1uof4BVm28GY=; b=hJ92r42LHPaqafTTwJ//U4xaN5YXiWdSAwpgCc4/931jtJ/Ous+BYRNd9KwT4bmbfB cSPEY7UVgOuKsAbLmb3zosWXjWZi+VwQrsHw4lByY0E5+VAxaPgP4qVplnPPFbr0/FX5 abnWPRq/T5W39g9YN8L9mw5Hxvv+kibi7rJGo52nIPIPpUDG78P0A/ub6lvo8ZykxgNC wMOOihlTln6ne0w/GBUWj0csfsZkPElcHksXzKDLXpM9VosobXXxpacS9JrR2kWyv5sH +AEIYesh+AdtvCZM2nfDK6AONRwo88MJnhoheDeDL+bs4cZQUzncG7+Gb5vBbeRC8yr4 Dgig== X-Gm-Message-State: AKS2vOxCM87nBql+FkgcL3dZFm0mrhavob9EP9KB3aUnVt5250M9XczB S3ybgPvyE/nFD9yd X-Received: by 10.25.145.71 with SMTP id y7mr12872892lfj.39.1499162096888; Tue, 04 Jul 2017 02:54:56 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id l67sm4851845lfg.18.2017.07.04.02.54.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 02:54:55 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Tue, 4 Jul 2017 11:54:36 +0200 Message-Id: <1499162088-1562-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499162088-1562-1-git-send-email-edgar.iglesias@gmail.com> References: <1499162088-1562-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PULL v1 05/17] target-microblaze: Introduce a use-barrel property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sai.pavan.boddu@xilinx.com, edgar.iglesias@xilinx.com, alistai@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Introduce a use-barrel property making barrel shifter instructions optional. Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- target/microblaze/cpu.c | 9 +++++---- target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 982cb61..bae47b5 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -150,8 +150,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) qemu_init_vcpu(cs); - env->pvr.regs[0] = PVR0_USE_BARREL_MASK \ - | PVR0_USE_DIV_MASK \ + env->pvr.regs[0] = PVR0_USE_DIV_MASK \ | PVR0_USE_HW_MUL_MASK \ | PVR0_USE_EXC_MASK \ | PVR0_USE_ICACHE_MASK \ @@ -162,7 +161,6 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) | PVR2_I_LMB_MASK \ | PVR2_USE_MSR_INSTR \ | PVR2_USE_PCMP_INSTR \ - | PVR2_USE_BARREL_MASK \ | PVR2_USE_DIV_MASK \ | PVR2_USE_HW_MUL_MASK \ | PVR2_USE_MUL64_MASK \ @@ -182,13 +180,15 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) env->pvr.regs[0] |= (cpu->cfg.stackprot ? PVR0_SPROT_MASK : 0) | (cpu->cfg.use_fpu ? PVR0_USE_FPU_MASK : 0) | + (cpu->cfg.use_barrel ? PVR0_USE_BARREL_MASK : 0) | (cpu->cfg.use_mmu ? PVR0_USE_MMU_MASK : 0) | (cpu->cfg.endi ? PVR0_ENDI_MASK : 0) | (version_code << PVR0_VERSION_SHIFT) | (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0); env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) | - (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0); + (cpu->cfg.use_fpu > 1 ? PVR2_USE_FPU2_MASK : 0) | + (cpu->cfg.use_barrel ? PVR2_USE_BARREL_MASK : 0); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -235,6 +235,7 @@ static Property mb_properties[] = { * are enabled */ DEFINE_PROP_UINT8("use-fpu", MicroBlazeCPU, cfg.use_fpu, 2), + DEFINE_PROP_BOOL("use-barrel", MicroBlazeCPU, cfg.use_barrel, true), DEFINE_PROP_BOOL("use-mmu", MicroBlazeCPU, cfg.use_mmu, true), DEFINE_PROP_BOOL("dcache-writeback", MicroBlazeCPU, cfg.dcache_writeback, false), diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 68c33e8..2a4a65a 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -298,6 +298,7 @@ struct MicroBlazeCPU { bool stackprot; uint32_t base_vectors; uint8_t use_fpu; + bool use_barrel; bool use_mmu; bool dcache_writeback; bool endi; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 0bb6095..26b221c 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -665,7 +665,7 @@ static void dec_barrel(DisasContext *dc) if ((dc->tb_flags & MSR_EE_FLAG) && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) - && !(dc->cpu->env.pvr.regs[0] & PVR0_USE_BARREL_MASK)) { + && !dc->cpu->cfg.use_barrel) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); return;