From patchwork Sat Feb 6 00:09:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 8240701 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4561FBEEE5 for ; Sat, 6 Feb 2016 00:14:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B4AC203B4 for ; Sat, 6 Feb 2016 00:14:13 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 507CB203B1 for ; Sat, 6 Feb 2016 00:14:12 +0000 (UTC) Received: from localhost ([::1]:50994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRqVv-00060N-Ix for patchwork-qemu-devel@patchwork.kernel.org; Fri, 05 Feb 2016 19:14:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRqSE-0007xg-Vb for qemu-devel@nongnu.org; Fri, 05 Feb 2016 19:10:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRqSB-0006t9-TJ for qemu-devel@nongnu.org; Fri, 05 Feb 2016 19:10:22 -0500 Received: from mail-qg0-x22b.google.com ([2607:f8b0:400d:c04::22b]:33744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRqSB-0006t5-OL for qemu-devel@nongnu.org; Fri, 05 Feb 2016 19:10:19 -0500 Received: by mail-qg0-x22b.google.com with SMTP id b35so80752585qge.0 for ; Fri, 05 Feb 2016 16:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=1juUsIh4fJMtgqpBg8wH4D0nzDYXt9CyjS+mobKAB1U=; b=TXxhqfIxXLKzxQqHB5vA7B+j6sjKKxGsHcZVA16BMIv7OplIJVZKZal4Qic2WP2BJx HwNHaZfV5W/vVqpgyV7mytlwn07M/ECZz3WGIUPKQcx1h9Gkud5GTYSNTaE2qZ03vuxy Q65puJeSilTf5DyILBpYA9QbZG1PLJIZiQdjLZ5JlI4WCMZXKDSjwn9dMQ9VCcNz6GP1 LHvaR/FiK9CCXm00/J6YTVuH2EHZUFK99qo9DGkNDHnb1VZajTzlORzkchCp7XhbRinY OC9aiE5kDzzeeLwaOzZZXMtF3PDApC1W9A56GWVOvbP1fmOj6MTftTw2YEkMfi5h/iwh 7MUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1juUsIh4fJMtgqpBg8wH4D0nzDYXt9CyjS+mobKAB1U=; b=Jm1eoNEwnpxU7C6FuxGrQZ+04dAYcxKGHLSK4wUr5+k0tPn/IjMZ7y3DZl0XyjqyVI WyLxRTWZ9aeXedWNIcSjeP35MmCEABb+IzS+4epLRYiMrOMNZE25RUz77jw8pr1CkDaJ /IJ7HdYJI68l2sKKjXn7edtREktDGU+3zQqooj/P2GixQ0n6X//wYjRLJYaXPQeXmNYY AI+PlcXpO7+Kh5boPqWmCJ/myFqP/jOFe8AeMS130g83pb9i+u2MNa/Vu8JNkrDKug9f hTKmvuzdSKmGVKcTPVU1/3M3gpmoQrQsQVklbp+degrQCLkCZuFQWLzg4qjy4QbcqhJv bG4Q== X-Gm-Message-State: AG10YORNZDqYJtSYhhdrj1iKcSXusGRMgoQdlMRkAShNAw29doxFE68InPPON9x+2m+aWg== X-Received: by 10.140.20.82 with SMTP id 76mr20333145qgi.5.1454717419522; Fri, 05 Feb 2016 16:10:19 -0800 (PST) Received: from bigtime.com ([1.129.57.172]) by smtp.gmail.com with ESMTPSA id w66sm9079564qhc.15.2016.02.05.16.10.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 16:10:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 6 Feb 2016 11:09:24 +1100 Message-Id: <1454717370-17516-7-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454717370-17516-1-git-send-email-rth@twiddle.net> References: <1454717370-17516-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::22b Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PULL 06/12] tcg: More use of TCGReg where appropriate 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/tcg.c | 26 +++++++++++++++----------- tcg/tcg.h | 8 ++++---- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 9a836c9..b50919a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -448,7 +448,7 @@ static inline TCGTemp *tcg_global_alloc(TCGContext *s) } static int tcg_global_reg_new_internal(TCGContext *s, TCGType type, - int reg, const char *name) + TCGReg reg, const char *name) { TCGTemp *ts; @@ -467,7 +467,7 @@ static int tcg_global_reg_new_internal(TCGContext *s, TCGType type, return temp_idx(s, ts); } -void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size) +void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size) { int idx; s->frame_start = start; @@ -476,7 +476,7 @@ void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size) s->frame_temp = &s->temps[idx]; } -TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name) +TCGv_i32 tcg_global_reg_new_i32(TCGReg reg, const char *name) { TCGContext *s = &tcg_ctx; int idx; @@ -488,7 +488,7 @@ TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name) return MAKE_TCGV_I32(idx); } -TCGv_i64 tcg_global_reg_new_i64(int reg, const char *name) +TCGv_i64 tcg_global_reg_new_i64(TCGReg reg, const char *name) { TCGContext *s = &tcg_ctx; int idx; @@ -1609,7 +1609,8 @@ static void dump_regs(TCGContext *s) static void check_regs(TCGContext *s) { - int reg, k; + TCGReg reg; + int k; TCGTemp *ts; char buf[64]; @@ -1662,7 +1663,7 @@ static void temp_allocate_frame(TCGContext *s, int temp) } /* sync register 'reg' by saving it to the corresponding temporary */ -static inline void tcg_reg_sync(TCGContext *s, int reg) +static inline void tcg_reg_sync(TCGContext *s, TCGReg reg) { TCGTemp *ts; int temp; @@ -1680,7 +1681,7 @@ static inline void tcg_reg_sync(TCGContext *s, int reg) } /* free register 'reg' by spilling the corresponding temporary if necessary */ -static void tcg_reg_free(TCGContext *s, int reg) +static void tcg_reg_free(TCGContext *s, TCGReg reg) { int temp; @@ -1693,9 +1694,10 @@ static void tcg_reg_free(TCGContext *s, int reg) } /* Allocate a register belonging to reg1 & ~reg2 */ -static int tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2) +static TCGReg tcg_reg_alloc(TCGContext *s, TCGRegSet reg1, TCGRegSet reg2) { - int i, reg; + int i; + TCGReg reg; TCGRegSet reg_ct; tcg_regset_andnot(reg_ct, reg1, reg2); @@ -1960,7 +1962,8 @@ static void tcg_reg_alloc_op(TCGContext *s, uint8_t sync_args) { TCGRegSet allocated_regs; - int i, k, nb_iargs, nb_oargs, reg; + int i, k, nb_iargs, nb_oargs; + TCGReg reg; TCGArg arg; const TCGArgConstraint *arg_ct; TCGTemp *ts; @@ -2136,7 +2139,8 @@ static void tcg_reg_alloc_call(TCGContext *s, int nb_oargs, int nb_iargs, const TCGArg * const args, uint16_t dead_args, uint8_t sync_args) { - int flags, nb_regs, i, reg; + int flags, nb_regs, i; + TCGReg reg; TCGArg arg; TCGTemp *ts; intptr_t stack_offset; diff --git a/tcg/tcg.h b/tcg/tcg.h index 8b7efed..3674739 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -448,7 +448,7 @@ typedef enum TCGTempVal { } TCGTempVal; typedef struct TCGTemp { - unsigned int reg:8; + TCGReg reg:8; TCGTempVal val_type:8; TCGType base_type:8; TCGType type:8; @@ -628,12 +628,12 @@ void tcg_func_start(TCGContext *s); int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf); -void tcg_set_frame(TCGContext *s, int reg, intptr_t start, intptr_t size); +void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); int tcg_global_mem_new_internal(TCGType, TCGv_ptr, intptr_t, const char *); -TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name); -TCGv_i64 tcg_global_reg_new_i64(int reg, const char *name); +TCGv_i32 tcg_global_reg_new_i32(TCGReg reg, const char *name); +TCGv_i64 tcg_global_reg_new_i64(TCGReg reg, const char *name); TCGv_i32 tcg_temp_new_internal_i32(int temp_local); TCGv_i64 tcg_temp_new_internal_i64(int temp_local);