From patchwork Tue May 29 10:50:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10435007 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 D8C07603B5 for ; Tue, 29 May 2018 11:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8543286E3 for ; Tue, 29 May 2018 11:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC9BD286F7; Tue, 29 May 2018 11:15:03 +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=-3.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, MAILING_LIST_MULTI, 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 48A38286E3 for ; Tue, 29 May 2018 11:15:03 +0000 (UTC) Received: from localhost ([::1]:60219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcak-0003Lz-4c for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 May 2018 07:15:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDa-0001qM-Ug for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcDa-0004Hw-79 for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:07 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:39950) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNcDZ-0004HJ-W7 for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:06 -0400 Received: by mail-wm0-x234.google.com with SMTP id x2-v6so31862588wmh.5 for ; Tue, 29 May 2018 03:51:05 -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 :mime-version:content-transfer-encoding; bh=cc3+xpBos8NzE2Nb7GIEFsRnslr4t2plfgNWJYViiOg=; b=Np6zZRe2cpj0uPg1EOuOzEYy40N6V1QDuAPK9AWrGixL59sqMKs/m6ABHSUtDOMQFg jqwSqvdtVp1KTZGuYf0JN9mU0iyfFK+aMD3APLYamXcu6hc9GNMnPjHdklpp5nv3T6my EKkZysVe95lNzlFFJLU4HDcdP4FbpGK+5jjt8lDtyKhwQMDiOUtxjtJmhjCdu/N69jwg zxv7VMRWA5/LpCtovCxa27H/U6EeQSerbro0TWXf+OSZ5HW9IslKmp6GH2j9jIogp6GK VCh3VJQwnnDjGcqRY8n6boT5j/eg/AZg+XkezMo+v5zoMAuni7+TbUZCeIxlbeAku+U3 zRGA== 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=cc3+xpBos8NzE2Nb7GIEFsRnslr4t2plfgNWJYViiOg=; b=k4JDyAqtrPVj95Gk9ENopMlV8ZJmhzZmoQ92zv+CqHzHGN1vTfSz4MLAi+yzVFxd0G EEEhsLAo6nPnTGROoIPyJYMuuUZcJF8B9GRaWAWgFHMFk0+SpnJ+E/idtm9TZSPtyQ02 LL/uZmtMsB9vNySIMhnvQBQA3ZBm56VV9iGbdxaAW+tNxIf49GrXr9ZrVnZvOIni25dh l3L+jXqZGom2iK906b8bA4QPye3lyHTIe4WWWL7C2+136AfFrUbmVKFf/Sduj9u7F8EV dZrOdJEXPqheMgHUY57iOYgbJnHPe8WdkQi50NIkbOw8T5kocug4thSPQ/oFqIHFL4IO /wvQ== X-Gm-Message-State: ALKqPwfl/fdYGl0zvV26cb/iVIvtiFi2IbVqkA6DVhPwUiM1dyyJV9CI zrUkVsHs2W6WSi6MPXAzTl32wQ== X-Google-Smtp-Source: ADUXVKLYjsQESBNbaRmmtPlRHuWqygEZ7tyc5rgtaQ0joW33P3nDNuePnWvDIvLfTvMOa94PmxFIww== X-Received: by 2002:a2e:56cb:: with SMTP id k72-v6mr10678102lje.140.1527591064584; Tue, 29 May 2018 03:51:04 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id q1-v6sm6323537lje.43.2018.05.29.03.51.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 03:51:03 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 12:50:04 +0200 Message-Id: <20180529105011.1914-32-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180529105011.1914-1-edgar.iglesias@gmail.com> References: <20180529105011.1914-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::234 Subject: [Qemu-devel] [PULL v1 31/38] target-microblaze: Simplify address computation using tcg_gen_addi_i32() 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org 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" Simplify address computation using tcg_gen_addi_i32(). tcg_gen_addi_i32() already optimizes the case when the immediate is zero. No functional change. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Edgar E. Iglesias --- target/microblaze/translate.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index bb6b5176c1..0d8ef77513 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -899,12 +899,7 @@ static inline void compute_ldst_addr(DisasContext *dc, bool ea, TCGv t) /* Immediate. */ t32 = tcg_temp_new_i32(); if (!extimm) { - if (dc->imm == 0) { - tcg_gen_mov_i32(t32, cpu_R[dc->ra]); - } else { - tcg_gen_movi_i32(t32, (int32_t)((int16_t)dc->imm)); - tcg_gen_add_i32(t32, cpu_R[dc->ra], t32); - } + tcg_gen_addi_i32(t32, cpu_R[dc->ra], (int16_t)dc->imm); } else { tcg_gen_add_i32(t32, cpu_R[dc->ra], *(dec_alu_op_b(dc))); }