From patchwork Mon Oct 16 17:25:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115954 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3950303qgn; Mon, 16 Oct 2017 10:45:26 -0700 (PDT) X-Received: by 10.55.183.134 with SMTP id h128mr15252828qkf.258.1508175926201; Mon, 16 Oct 2017 10:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508175926; cv=none; d=google.com; s=arc-20160816; b=S+PIgkk8cqXbPAU1Oduh0SbbLAUkG3T3H/ubJXS+GEALh785HCPOON5KDtoz9W2QsC U7ME3GSGhSz4L1+tAwaiZaWz0IGwIphQTPvmV15IhtkQucxRk03pS1O4gW4Q7Q4V54SH bUIAnuAlxYGyqkqf3nvCDB6gQHYLp9Bsu5WWZM5Pp5ZTWets08y3SClboNApMhS8aYLg aDv+otGJIwrVHEY4NIG4d/uRuDDmrNe/3htFM2xbALzHoLmdM+cEkOjZu69tptTdwHBA f8ia+5kqrz0jNAMNfGWjx3AlXPk+V1KHwF+T0oUGrU8x2sGyLRlEHkI5FkxpshyXb65l 27fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=u0QX5W2ChFDKotIY5fy9QRJPxN94Nx0++sj/1I+ayIo=; b=oFh0h6gK+R7m24fxmFujPA8U2eTRNnQtiJXj9WigrXcvQcx3RMmpZtvmqR92lX5pqn mpKYqW0SGPCe9GQ0uV5VAZaiOzYhq9zMZHZG4MgmZclKSIjRRSgDcoULRhr5nzYPnK8e 4qjYYYNiwmGoaosvmGb22+uvp0/YPP/TTFEnwOhz8oJtDhcCSEyKXJmcRj/79pWd+rLx u0E7N4QKSeqAVrnU5wYYGy4CfxP4/YcOYdCmm3cVNie2yn38n2zqFnMqKM3EZbCxYev5 RkixP/MWV7mpJSInSQ+VgrF8TjaJk6zGNry8rGprPNXrAw56mtket1S1oOye1y3AD2KV 6NRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RJgShSMC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a13si1339925qkj.345.2017.10.16.10.45.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RJgShSMC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49S8-0000zX-5W for patch@linaro.org; Mon, 16 Oct 2017 13:45:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e499t-00026Z-Kp for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e499s-0003SC-Nk for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:33 -0400 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]:51667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e499s-0003RQ-DK for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:32 -0400 Received: by mail-pf0-x22b.google.com with SMTP id n14so16279924pfh.8 for ; Mon, 16 Oct 2017 10:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=u0QX5W2ChFDKotIY5fy9QRJPxN94Nx0++sj/1I+ayIo=; b=RJgShSMCAjcfmEayH8aE+sbXcxt70xhYTr+zPclrv2ZwW2YM3npC3wc30cSbvrccFb DNfH4N3taAnirn29cUp71CqkyKXkTZB97CNaY62jVSE16iZs3FI5kuL7/j7oCJAQdhGu OC7a6zpwynsYtjPES+7IkfUvjhZ9RnDy8sskI= 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; bh=u0QX5W2ChFDKotIY5fy9QRJPxN94Nx0++sj/1I+ayIo=; b=S9eh0HhRNgY/AIYW9AA6NK+2pRJAcEcTXCVmPprE0DI5OJj8BkXES7gz5zGgOHctSw VCd1CRlB/qB31PhHoMmDZ1JM0EyHVAHduk0dDrT4xfI2WaJgJcFZpVqzC7bXyfrIkF1x v9LxFZZTe4W78RI7y1Yv4qtmXih0c+q0P/EAxjgIy31+IZteRjTISa1WBftpFxg08vyr tQVdnoian4LTePGv1uBSWVJ4L4+UnweW83QDwDmxGjbT6zyau84PIY3JOKyHdbOw46Fe mz4K0E0ho6ns0kEGcFtZo0KSaF1Bn3Pz9kb86A6UACk9LZYuwNn2/60+HL9BujPIWuAt Dnow== X-Gm-Message-State: AMCzsaUwc2CIDp2GkYOd1I3KUUi6QyRD5gN1Xl2AJdKeuzZBLjiKidIf iJbaSwpPBJlJvENxa2Xs+LpuPghbsJk= X-Google-Smtp-Source: ABhQp+Qq353R0XBDANIM2xJy5zpelCDKYB7Sru6IFOJDA0ej/o8mXTDuyx6R0B8wpifZJr+YJ9zr8Q== X-Received: by 10.84.138.131 with SMTP id 3mr68361plp.238.1508174790953; Mon, 16 Oct 2017 10:26:30 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id i187sm5594249pfc.96.2017.10.16.10.26.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:26:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:25:32 -0700 Message-Id: <20171016172609.23422-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171016172609.23422-1-richard.henderson@linaro.org> References: <20171016172609.23422-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22b Subject: [Qemu-devel] [PATCH v6 13/50] tcg: Export temp_idx 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: cota@braap.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson At the same time, drop the TCGContext argument and use tcg_ctx instead. Signed-off-by: Richard Henderson --- tcg/tcg.h | 7 ++++++- tcg/tcg.c | 15 ++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) -- 2.13.6 Reviewed-by: Emilio G. Cota diff --git a/tcg/tcg.h b/tcg/tcg.h index e0615de90f..c50805217c 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -734,13 +734,18 @@ struct TCGContext { extern TCGContext tcg_ctx; extern bool parallel_cpus; -static inline TCGArg temp_arg(TCGTemp *ts) +static inline size_t temp_idx(TCGTemp *ts) { ptrdiff_t n = ts - tcg_ctx.temps; tcg_debug_assert(n >= 0 && n < tcg_ctx.nb_temps); return n; } +static inline TCGArg temp_arg(TCGTemp *ts) +{ + return temp_idx(ts); +} + static inline TCGTemp *arg_temp(TCGArg a) { return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a]; diff --git a/tcg/tcg.c b/tcg/tcg.c index 163ec8b1c0..b39944d42a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -473,13 +473,6 @@ void tcg_func_start(TCGContext *s) s->gen_next_op_idx = 1; } -static inline int temp_idx(TCGContext *s, TCGTemp *ts) -{ - ptrdiff_t n = ts - s->temps; - tcg_debug_assert(n >= 0 && n < s->nb_temps); - return n; -} - static inline TCGTemp *tcg_temp_alloc(TCGContext *s) { int n = s->nb_temps++; @@ -516,7 +509,7 @@ static int tcg_global_reg_new_internal(TCGContext *s, TCGType type, ts->name = name; tcg_regset_set_reg(s->reserved_regs, reg); - return temp_idx(s, ts); + return temp_idx(ts); } void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size) @@ -605,7 +598,7 @@ int tcg_global_mem_new_internal(TCGType type, TCGv_ptr base, ts->mem_offset = offset; ts->name = name; } - return temp_idx(s, ts); + return temp_idx(ts); } static int tcg_temp_new_internal(TCGType type, int temp_local) @@ -645,7 +638,7 @@ static int tcg_temp_new_internal(TCGType type, int temp_local) ts->temp_allocated = 1; ts->temp_local = temp_local; } - idx = temp_idx(s, ts); + idx = temp_idx(ts); } #if defined(CONFIG_DEBUG_TCG) @@ -1186,7 +1179,7 @@ static void tcg_reg_alloc_start(TCGContext *s) static char *tcg_get_arg_str_ptr(TCGContext *s, char *buf, int buf_size, TCGTemp *ts) { - int idx = temp_idx(s, ts); + int idx = temp_idx(ts); if (ts->temp_global) { pstrcpy(buf, buf_size, ts->name);