From patchwork Mon Oct 16 17:25:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115935 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3938523qgn; Mon, 16 Oct 2017 10:31:59 -0700 (PDT) X-Received: by 10.55.186.196 with SMTP id k187mr8252249qkf.94.1508175119851; Mon, 16 Oct 2017 10:31:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508175119; cv=none; d=google.com; s=arc-20160816; b=K0NLUenHt+GtA+E2NmxPco21wnouy6dcxGkxUyJB1expHjvYE+SkiakltSRjm5pSy4 Wg40Jx6JTqbd7HAg79uY4MWP739jpZECo/XoiNHHdkesvDzzJLSbSbPzxrm5RT5BTMjN sXBvdpYKQICHhxiLsMY2iOhAI3VghcMYKEAoJQD5X22VtOBkyr6Eu7hLe2nmgGuTmHER PTwb5Yp3ZCtASOw2fq0mm5DgKOME/kyA94zA3/Jge+BETqYXY+LNpleVT01t69+fCEG6 hqQYAtqpGQD2tuU8WdsUqxUe/TzyZB2DXSLoPSb9kvoFCkw6jximo4y9n0hFVIQ6AAUu YGxw== 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=QjHyql3jVDRWJPR9yAKq1NOoZjivpNEciuPakz2ZW28=; b=KHgIkIQsUgnTDg1qfGzL1dkHKtGjS3BfDanr8xcFD79EwLpNlB9NlFzfpWjf2K92YR FCF3LGSvQDS36+Es8ThGiWpkr+TDwPU+1c5zmBarb6gtud+6JsKd804nqmOOAHCTbRrD 8kk4F5JYJiaUlOSRhqCOQ943sbLXh5Ac31YW2yakamqhcwlsZ0W0QAKpH95cngEcJv78 Bp9kpom14EahszvVqBrmW95ZCa1UYuzElWRLVkJMjx9S7ni8ds44cv53ylbgLAnh+APk 9stZwmiUHRa+us7Z2A1Nj4b4sb0CaPUpnSqfQCnd4kBL4wrgx6ApHOPUx0kw1TK6Df5H DMNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WFxTFTWd; 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 62si6785431qth.150.2017.10.16.10.31.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:31:59 -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=WFxTFTWd; 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]:34318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49F7-0006sJ-PQ for patch@linaro.org; Mon, 16 Oct 2017 13:31:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e499n-0001yR-Eb for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e499l-0003MN-Nn for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:27 -0400 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]:55270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e499l-0003LY-I2 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:25 -0400 Received: by mail-pg0-x22c.google.com with SMTP id l24so7292738pgu.11 for ; Mon, 16 Oct 2017 10:26:25 -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=QjHyql3jVDRWJPR9yAKq1NOoZjivpNEciuPakz2ZW28=; b=WFxTFTWd9RAaFmkv/Ht4gWBs7jCJ2iotQfyUWmlNuc0CeoII3VPtOG5OzF7+Kx8asT lymlyvQtlik+9rf7jYld9tONn6jFGQtovc9m0qG0n1AwchCkJec3OzeMoz8TCw4/Hz5Q /n3OLxbDpP+FXI40uV5nChGJdXFbt3ExH/Dfw= 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=QjHyql3jVDRWJPR9yAKq1NOoZjivpNEciuPakz2ZW28=; b=qswdHyykmuZVKbchDusVn5I283pCAQGhSZ0cuJ1K0zlY2bHBvKgC+1VcDbGlZ6U/f9 3pkgs7UVYH7SlHtfgG4BsEm0xL3dAA3g9vBhTlan4GHqSxU69aJ+3GdJqGptwNx7eBUZ fa2IWDgedoDDY6tH2qVEmAgoCf8VbfxPkQKssJMTzISVDPoMjQrTs01YSOr7yWo1/YrG DhQb+Bj1RSKhMS5fWmKFLmVC1SUTy/N3K5uN4bsD2kxz7OHClQfeApTCP3Ht4+GF/PfS A9JW8wA9Jl+RBZBPDTyZF24Zqq3DQ8uQO9rYpdRtwkBJH3s8Vv/kOFU7SuHDnjRf/bf1 Tmyw== X-Gm-Message-State: AMCzsaURqpdlRBAtTVq+TgqVSotbtI3hBnQ4WGgsTSyuANBmCuYxGod4 t1iCbjcESAUPixH4kp76Lwt8RsG3nVQ= X-Google-Smtp-Source: AOwi7QCyyFaXQdK40xY/wBFH3QRl6hr0djQkcxMN3UaqEuMh/4FRE/NZGb82HK4G+j1ZL5f0hPaoJw== X-Received: by 10.99.108.2 with SMTP id h2mr8877427pgc.362.1508174784405; Mon, 16 Oct 2017 10:26:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:26:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:25:27 -0700 Message-Id: <20171016172609.23422-9-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:c05::22c Subject: [Qemu-devel] [PATCH v6 08/50] tcg: Introduce temp_arg 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 Signed-off-by: Richard Henderson --- tcg/tcg.h | 7 +++++++ tcg/tcg.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) -- 2.13.6 Reviewed-by: Emilio G. Cota diff --git a/tcg/tcg.h b/tcg/tcg.h index 5fcdec1fc5..1e456d8e5a 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -729,6 +729,13 @@ struct TCGContext { extern TCGContext tcg_ctx; extern bool parallel_cpus; +static inline TCGArg temp_arg(TCGTemp *ts) +{ + ptrdiff_t n = ts - tcg_ctx.temps; + tcg_debug_assert(n >= 0 && n < tcg_ctx.nb_temps); + return n; +} + 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 915e041bea..31279ab3bb 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1941,7 +1941,7 @@ static bool liveness_pass_2(TCGContext *s, uint8_t *temp_state) TCGOp *lop = tcg_op_insert_before(s, op, lopc, 3); lop->args[0] = dir; - lop->args[1] = temp_idx(s, its->mem_base); + lop->args[1] = temp_arg(its->mem_base); lop->args[2] = its->mem_offset; /* Loaded, but synced with memory. */ @@ -2012,7 +2012,7 @@ static bool liveness_pass_2(TCGContext *s, uint8_t *temp_state) TCGOp *sop = tcg_op_insert_after(s, op, sopc, 3); sop->args[0] = dir; - sop->args[1] = temp_idx(s, its->mem_base); + sop->args[1] = temp_arg(its->mem_base); sop->args[2] = its->mem_offset; temp_state[arg] = TS_MEM;