From patchwork Tue Apr 13 22:26:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 51176 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 9F497B7D45 for ; Thu, 29 Apr 2010 04:33:54 +1000 (EST) Received: from localhost ([127.0.0.1]:47207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7C50-0002Hj-GF for incoming@patchwork.ozlabs.org; Wed, 28 Apr 2010 14:33:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O7C1b-0000IO-Rs for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:30:19 -0400 Received: from [140.186.70.92] (port=46586 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O7C1V-0000Es-HT for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:30:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O7C1Q-0004QF-Re for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:30:13 -0400 Received: from are.twiddle.net ([75.149.56.221]:36474) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O7C1Q-0004Pa-Ku for qemu-devel@nongnu.org; Wed, 28 Apr 2010 14:30:08 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id CAC78B07; Wed, 28 Apr 2010 11:30:05 -0700 (PDT) Message-Id: <6fd466d920f00ec7ea42dcc43c8c2f0e9f99eaf2.1272479073.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Tue, 13 Apr 2010 15:26:17 -0700 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 02/22] tcg-i386: Tidy initialization of tcg_target_call_clobber_regs. 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 Setting the registers one by one is easier to read, and gets optimized by the compiler just the same. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index f5c24f7..359f81b 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -1365,11 +1365,12 @@ void tcg_target_init(TCGContext *s) #endif tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xff); - tcg_regset_set32(tcg_target_call_clobber_regs, 0, - (1 << TCG_REG_EAX) | - (1 << TCG_REG_EDX) | - (1 << TCG_REG_ECX)); - + + tcg_regset_clear(tcg_target_call_clobber_regs); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_EAX); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_EDX); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_ECX); + tcg_regset_clear(s->reserved_regs); tcg_regset_set_reg(s->reserved_regs, TCG_REG_ESP);