From patchwork Thu Oct 24 21:08:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 286034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2E7A22C00CA for ; Fri, 25 Oct 2013 08:30:55 +1100 (EST) Received: from localhost ([::1]:56292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSFb-0006kE-DW for incoming@patchwork.ozlabs.org; Thu, 24 Oct 2013 17:15:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSCj-0002bO-NA for qemu-devel@nongnu.org; Thu, 24 Oct 2013 17:12:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZSCb-0006Re-9j for qemu-devel@nongnu.org; Thu, 24 Oct 2013 17:12:29 -0400 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:38685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSCb-0006RP-1m for qemu-devel@nongnu.org; Thu, 24 Oct 2013 17:12:21 -0400 Received: by mail-lb0-f169.google.com with SMTP id o14so73071lbi.14 for ; Thu, 24 Oct 2013 14:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=5YaziSnzKgG4Ov78Ex2JU+N207pDbIS7KK9+RnM5vzw=; b=moKY60Hpt0y8lpdlXmCd776TACCm33/deWSjVvy9DMqailqJxRN8P6rowM6uDLf+e4 DjrYxYAgGxvQ2G7t6UDX6r4WUIt1GXEJ6ff5o3ROF6Syiyhtc0pEcIgax9YzyhHfdvzp oHN2qeWXTFIZFkrwDfObQMbZC8gm2ZufEd0wBQrBchVqw2pdjr9l1jDmDrvqJvA5G3fp NAxZZlz7ilVgcF6gXXf9HXmOEROp8TojI1NgTiGDS32R7LORJ8t7nvuw/ATe69u5fci7 7H+Loo2Z6DQCTKk2zqtTLKhxpol8rm4ur5zYifF8PQTbhH0JVHvzdMVn7PDPpqNo0+as 55kw== X-Received: by 10.112.50.41 with SMTP id z9mr52054lbn.83.1382649140077; Thu, 24 Oct 2013 14:12:20 -0700 (PDT) Received: from localhost (h59ec325f.selukar.dyn.perspektivbredband.net. [89.236.50.95]) by mx.google.com with ESMTPSA id os9sm159441lbb.17.2013.10.24.14.12.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Oct 2013 14:12:19 -0700 (PDT) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Thu, 24 Oct 2013 23:08:52 +0200 Message-Id: <1382648937-14769-6-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1382648937-14769-1-git-send-email-edgar.iglesias@gmail.com> References: <1382648937-14769-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::229 Subject: [Qemu-devel] [PATCH 05/10] microblaze: Improve src X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Microblaze carry is mirrored in MSR[31], pick it directly from there. Also, no need to mask cpu_R[dc->ra] when calling write_carry. 15% improvement in linux-user src loops. Signed-off-by: Edgar E. Iglesias --- target-microblaze/translate.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 93aafac..232015a 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -750,7 +750,7 @@ static void dec_barrel(DisasContext *dc) static void dec_bit(DisasContext *dc) { - TCGv t0, t1; + TCGv t0; unsigned int op; int mem_index = cpu_mmu_index(dc->env); @@ -761,19 +761,12 @@ static void dec_bit(DisasContext *dc) t0 = tcg_temp_new(); LOG_DIS("src r%d r%d\n", dc->rd, dc->ra); - tcg_gen_andi_tl(t0, cpu_R[dc->ra], 1); + tcg_gen_andi_tl(t0, cpu_SR[SR_MSR], MSR_CC); + write_carry(dc, cpu_R[dc->ra]); if (dc->rd) { - t1 = tcg_temp_new(); - read_carry(dc, t1); - tcg_gen_shli_tl(t1, t1, 31); - tcg_gen_shri_tl(cpu_R[dc->rd], cpu_R[dc->ra], 1); - tcg_gen_or_tl(cpu_R[dc->rd], cpu_R[dc->rd], t1); - tcg_temp_free(t1); + tcg_gen_or_tl(cpu_R[dc->rd], cpu_R[dc->rd], t0); } - - /* Update carry. */ - write_carry(dc, t0); tcg_temp_free(t0); break;