From patchwork Tue Jun 20 15:51:26 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: 9799883 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 C117360328 for ; Tue, 20 Jun 2017 15:59:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F8B32624A for ; Tue, 20 Jun 2017 15:59:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9451A284B0; Tue, 20 Jun 2017 15:59:40 +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 1EFDC2624A for ; Tue, 20 Jun 2017 15:59:40 +0000 (UTC) Received: from localhost ([::1]:49458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLZ5-0003hO-Bj for patchwork-qemu-devel@patchwork.kernel.org; Tue, 20 Jun 2017 11:59:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLRO-00057Q-5K for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNLRM-00040j-Lk for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:42 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:32917) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNLRM-00040a-E4 for qemu-devel@nongnu.org; Tue, 20 Jun 2017 11:51:40 -0400 Received: by mail-lf0-x241.google.com with SMTP id u62so15460504lfg.0 for ; Tue, 20 Jun 2017 08:51:40 -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=MnaQqm3UlHzR4TWrkipVdWXvAYALMixwJHiUXGXh17c=; b=GAs1MN/4R2vmZXlJ6yZ4HUxLKCPnnVtsQjZjKPsx7bNphiX9nvMo9gIoEuXudAOrYr TN2zKqtKkBAvRc3PCXpQ4dx11v1Asglale4NZr6ZR7WXpSPuzE17GYz3bIjdZrBERq4/ H1H2zSVpfRL+3pXzcuK3Q3MnQ128IS9JJ/aRBahdbmwkP+UmBvCCsrwDp42uRivxeH44 z9x3vdrtuhrEvdlY6jg0pe/ivSSuohc7wMr/bvm7VvxD6iVlRwWMEFuGWuUFQQ86Bqm/ a34wVli7sc7RksgQa3EqhOFjY5tK7Wr0sKe+eYXTHY871Bxlx/L638IifhAwJVS2hqth IjvA== 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=MnaQqm3UlHzR4TWrkipVdWXvAYALMixwJHiUXGXh17c=; b=jDGgMbP5BANXeTJ/+q8m+SsgWyCN1fSEf7RHtfNyDev4n+ngXsr+ggE9WroShmOIJx 6yNII11Pa/VT2gXB25wDMkR2EAlpGtQgloN1K0qYhESsQd8BXULQsoZg/37foMmYKIEX XTPOUajOkQFYS3FOKrlgLSPnKu4GnFPBovIsPWQaUCfTUK3lh0AlMR1v+BofTbrWTqP/ jIcu2IlHe2XifVPycVHr4zW1COFGfGWoU4635r1mXs+CU7Yo7xHLyav8mp0nucMFMYIB LV2OisfLOv9wcOVVz/WthE0ddWQ4NYtiuEyqJhnwahBCA/q7xh3jhJUrr3uCBj+ntNcZ papg== X-Gm-Message-State: AKS2vOye5EHqj/PrMG/pod5Z5TXJ/FxTLlYoQt+hqi904edDnMHGmDEi Kr00tHmCoRBk0yaw X-Received: by 10.46.70.9 with SMTP id t9mr8889840lja.117.1497973898845; Tue, 20 Jun 2017 08:51:38 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id y10sm2321171lja.24.2017.06.20.08.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 08:51:37 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 20 Jun 2017 17:51:26 +0200 Message-Id: <1497973886-26257-9-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497973886-26257-1-git-send-email-edgar.iglesias@gmail.com> References: <1497973886-26257-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::241 Subject: [Qemu-devel] [PATCH v1 8/8] target-microblaze: Introduce a use-pcmp-instr 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-pcmp-instr property making pcmp instructions optional. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- target/microblaze/cpu.c | 5 +++-- target/microblaze/cpu.h | 1 + target/microblaze/translate.c | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index bc96505..6e27c3c 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -157,7 +157,6 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) | PVR2_D_LMB_MASK \ | PVR2_I_OPB_MASK \ | PVR2_I_LMB_MASK \ - | PVR2_USE_PCMP_INSTR \ | PVR2_FPU_EXC_MASK \ | 0; @@ -188,7 +187,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp) (cpu->cfg.use_hw_mul > 1 ? PVR2_USE_MUL64_MASK : 0) | (cpu->cfg.use_barrel ? PVR2_USE_BARREL_MASK : 0) | (cpu->cfg.use_div ? PVR2_USE_DIV_MASK : 0) | - (cpu->cfg.use_msr_instr ? PVR2_USE_MSR_INSTR : 0); + (cpu->cfg.use_msr_instr ? PVR2_USE_MSR_INSTR : 0) | + (cpu->cfg.use_pcmp_instr ? PVR2_USE_PCMP_INSTR : 0); env->pvr.regs[5] |= cpu->cfg.dcache_writeback ? PVR5_DCACHE_WRITEBACK_MASK : 0; @@ -242,6 +242,7 @@ static Property mb_properties[] = { DEFINE_PROP_BOOL("use-barrel", MicroBlazeCPU, cfg.use_barrel, true), DEFINE_PROP_BOOL("use-div", MicroBlazeCPU, cfg.use_div, true), DEFINE_PROP_BOOL("use-msr-instr", MicroBlazeCPU, cfg.use_msr_instr, true), + DEFINE_PROP_BOOL("use-pcmp-instr", MicroBlazeCPU, cfg.use_pcmp_instr, 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 5c960d0..5ce4c82 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -302,6 +302,7 @@ struct MicroBlazeCPU { bool use_barrel; bool use_div; bool use_msr_instr; + bool use_pcmp_instr; bool use_mmu; bool dcache_writeback; bool endi; diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index bb1bdfa..fbb8bb4 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -326,7 +326,7 @@ static void dec_pattern(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[2] & PVR2_USE_PCMP_INSTR))) { + && !dc->cpu->cfg.use_pcmp_instr) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); } @@ -762,11 +762,11 @@ static void dec_bit(DisasContext *dc) case 0xe0: if ((dc->tb_flags & MSR_EE_FLAG) && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) - && !((dc->cpu->env.pvr.regs[2] & PVR2_USE_PCMP_INSTR))) { + && !dc->cpu->cfg.use_pcmp_instr) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); } - if (dc->cpu->env.pvr.regs[2] & PVR2_USE_PCMP_INSTR) { + if (dc->cpu->cfg.use_pcmp_instr) { tcg_gen_clzi_i32(cpu_R[dc->rd], cpu_R[dc->ra], 32); } break;