From patchwork Wed Oct 21 10:17:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Juha.Riihimaki@nokia.com X-Patchwork-Id: 36528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D76CBB7B7C for ; Wed, 21 Oct 2009 22:05:44 +1100 (EST) Received: from localhost ([127.0.0.1]:39816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0Z0e-00056C-UO for incoming@patchwork.ozlabs.org; Wed, 21 Oct 2009 07:05:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0YHF-0006pU-VJ for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0YHA-0006lI-W0 for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:45 -0400 Received: from [199.232.76.173] (port=43295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0YHA-0006l3-Ma for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:40 -0400 Received: from smtp.nokia.com ([192.100.105.134]:48663 helo=mgw-mx09.nokia.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N0YHA-0000cn-2i for qemu-devel@nongnu.org; Wed, 21 Oct 2009 06:18:40 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9LAITF9005362 for ; Wed, 21 Oct 2009 05:18:38 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 21 Oct 2009 13:18:17 +0300 Received: from vaebh101.NOE.Nokia.com ([10.160.244.22]) by vaebh104.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 21 Oct 2009 13:17:45 +0300 Received: from smtp.mgd.nokia.com ([65.54.30.6]) by vaebh101.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 21 Oct 2009 13:17:39 +0300 Received: from NOK-EUMSG-05.mgdnok.nokia.com ([65.54.30.90]) by nok-am1mhub-02.mgdnok.nokia.com ([65.54.30.6]) with mapi; Wed, 21 Oct 2009 12:17:37 +0200 From: To: Date: Wed, 21 Oct 2009 12:17:52 +0200 Thread-Topic: [PATCH 05/12] target-arm: optimize vfp load/store multiple ops Thread-Index: AcpSN7bYEAzuwQcpTqiyAkL0NH3Bqg== Message-ID: Accept-Language: en, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en, en-US MIME-Version: 1.0 X-OriginalArrivalTime: 21 Oct 2009 10:17:39.0003 (UTC) FILETIME=[B79318B0:01CA5237] X-Nokia-AV: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) Subject: [Qemu-devel] [PATCH 05/12] target-arm: optimize vfp load/store multiple ops X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org VFP load/store multiple instructions can be slightly optimized by loading the register offset constant into a variable outside the register loop and using the preloaded variable inside the loop instead of reloading the offset value to a temporary variable on each loop iteration. This causes less TCG ops to be generated for a VFP load/ store multiple instruction. Signed-off-by: Juha Riihimäki --- /* load */ @@ -3232,8 +3233,9 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn) gen_mov_F0_vreg(dp, rd + i); gen_vfp_st(s, dp, addr); } - tcg_gen_addi_i32(addr, addr, offset); + tcg_gen_add_i32(addr, addr, tmp); } + tcg_temp_free_i32(tmp); if (insn & (1 << 21)) { /* writeback */ if (insn & (1 << 24)) diff --git a/target-arm/translate.c b/target-arm/translate.c index 07ee638..e5a2881 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -3222,6 +3222,7 @@ static int disas_vfp_insn(CPUState * env, DisasContext *s, uint32_t insn) offset = 8; else offset = 4; + tmp = tcg_const_i32(offset); for (i = 0; i < n; i++) { if (insn & ARM_CP_RW_BIT) {