Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqYeF-00038U-IR for qemu-devel@nongnu.org; Sun, 05 Apr 2009 16:08:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqYeE-00037Y-Ok for qemu-devel@nongnu.org; Sun, 05 Apr 2009 16:08:55 -0400 Received: from [199.232.76.173] (port=43747 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqYeE-00037L-JO for qemu-devel@nongnu.org; Sun, 05 Apr 2009 16:08:54 -0400 Received: from savannah.gnu.org ([199.232.41.3]:49535 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LqYeE-00059F-7x for qemu-devel@nongnu.org; Sun, 05 Apr 2009 16:08:54 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LqYeA-0004VV-I4 for qemu-devel@nongnu.org; Sun, 05 Apr 2009 20:08:50 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LqYeA-0004VR-BX for qemu-devel@nongnu.org; Sun, 05 Apr 2009 20:08:50 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sun, 05 Apr 2009 20:08:50 +0000 Subject: [Qemu-devel] [7003] tcg/x86_64: optimize register allocation order Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7003 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7003 Author: aurel32 Date: 2009-04-05 20:08:50 +0000 (Sun, 05 Apr 2009) Log Message: ----------- tcg/x86_64: optimize register allocation order The beginning of the register allocation order list on the TCG x86_64 target matches the list of clobbered registers. This means that when an helper is called, there is almost always clobbered registers that have to be spilled. The same way register %rsi and %rdi are at the top of the register allocation order list, while they can't be used for load/store operations. This means the data and/or address registers are very often %rsi and %rdi, and their values have to be spilled, and then moved back to another register. This patches changes to the allocation order to avoid those effects. It results in a 8% gain speed in qemu-x86_64 to compress a bzip2 file, and a 6% gain in qemu-system-mips64 to compile a small application. Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/tcg/x86_64/tcg-target.c Modified: trunk/tcg/x86_64/tcg-target.c =================================================================== --- trunk/tcg/x86_64/tcg-target.c 2009-04-05 19:33:41 UTC (rev 7002) +++ trunk/tcg/x86_64/tcg-target.c 2009-04-05 20:08:50 UTC (rev 7003) @@ -44,22 +44,21 @@ #endif static const int tcg_target_reg_alloc_order[] = { - TCG_REG_RDI, - TCG_REG_RSI, - TCG_REG_RDX, - TCG_REG_RCX, - TCG_REG_R8, - TCG_REG_R9, - TCG_REG_RAX, - TCG_REG_R10, - TCG_REG_R11, - TCG_REG_RBP, TCG_REG_RBX, TCG_REG_R12, TCG_REG_R13, TCG_REG_R14, TCG_REG_R15, + TCG_REG_R10, + TCG_REG_R11, + TCG_REG_R9, + TCG_REG_R8, + TCG_REG_RCX, + TCG_REG_RDX, + TCG_REG_RSI, + TCG_REG_RDI, + TCG_REG_RAX, }; static const int tcg_target_call_iarg_regs[6] = {