From patchwork Mon Oct 16 17:25:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115943 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3943803qgn; Mon, 16 Oct 2017 10:37:47 -0700 (PDT) X-Received: by 10.55.33.203 with SMTP id f72mr15177347qki.176.1508175467674; Mon, 16 Oct 2017 10:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508175467; cv=none; d=google.com; s=arc-20160816; b=pbTSZ8PEhb5/m3uBLpSPqOy8XFkYkFLt3MrPgunEnWgprU20mBInI6z6owHt6MiTkl uMykCHy4KZ1lauY+tm1k0J8akaK7RE6wZdMoY4NHgM0lFgjENK5erSbOmXeyfqKP0OE5 +wVF3MOeJwZzjn3yMfZmI7o8IiRmnzBL0uB25cM2ulOBMUW0g1C6cecp21MgoZuIjmpJ wOWYEhqaQkTPu2H+jmjNrsUwcLCXfjyhotKzMuBM+W6BOH2BmfQeEhgxZ/dVNg77Se7o a/OqJFKNIZrNH9bSq1+UCP+Awx7voGLz4oO6Kinik8eh0SNV7EWAc7V/MiBzThp5Zi5L 6crQ== 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=CKzrL3nrIbxNWEEUClAtJxQyYcnjHcU6IGSZwQDG0YE=; b=PzTmEWy0eOSCaXv9CYVqBsvAqtkRNcFQEu8GZa+diIzbWpJDoE4KZODsLU5SsYoRMv kwUQM04VMLpTOvaIXAFgeToEYTPQHppKlc2tdX8luXIviltwFoLFbwbp85ITfiTwMrZb UUom7kCG6kaN8aZ6xN3c//oFRccu0dUjNkKoVFjglYZnyPTSV222ajjYphioHmwuMWsz Oy9fO1nmeIr8PwALeOkpY0gD1e29ozXC7GN5toC8hBBj0AZF/Q0BVxa8EZUenm86ZJ41 ueYAQ+kZOLLdX/vIxzixH8sYDKBmlw7R4+JauCjiF5py6aCpwfdcfkmA7D17umHBNVgN Jcmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZbTWWpez; 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 g16si454106qtk.436.2017.10.16.10.37.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 10:37:47 -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=ZbTWWpez; 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]:34340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49Kj-0003AC-I2 for patch@linaro.org; Mon, 16 Oct 2017 13:37:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49A5-0002JH-Hc for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e49A4-0003aR-JF for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:45 -0400 Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:44288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e49A4-0003Zv-DQ for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:26:44 -0400 Received: by mail-pf0-x22a.google.com with SMTP id x7so16317335pfa.1 for ; Mon, 16 Oct 2017 10:26:44 -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=CKzrL3nrIbxNWEEUClAtJxQyYcnjHcU6IGSZwQDG0YE=; b=ZbTWWpez/7DqTR8WXo+ltznZXYs9OmU3R+UH5rU84ya2DUIN7B7HogfD6xuwfq6kWm nPGsmgNYvf3aIZcJcD4cFj2EPB5+eSz94aw2b4RiVsWcmWUF9cYRGcGAez5FT7tO6pCk UVKjVU+hlnrkB2vnD1hLBH1ypBfkrP9/Gq7RY= 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=CKzrL3nrIbxNWEEUClAtJxQyYcnjHcU6IGSZwQDG0YE=; b=k3AHD6tsF9fijXwmtBf/iHOcZY1zoR0okmK3hSHEQqtLtKghTWZA13KxUzhZs6fr0R pZooFlY2FBqlYdp9ipUHYwl2jSSBSOC7ekku2j52seOHkoj3zwCYxBEEXt9Sx3Qo9ym6 5Kt0LBugcTunuqwu6dJVUMvCICrkA7mQuCzvPZnTexla2rikzOuF1ck9yxytf8Yng+oE loUy504IDNe8NcWYyDz+AMNautDtgMS6afkOysESOiVHJ2qI5XeRZomkk6BqhaaDtbxJ tSBC/ExO8mYNIjU6NGL+Fqg/iOz1eQGMH6o95PmMpk5z3Yo1gTKzAlLmwz9NkQLtyDiQ DOag== X-Gm-Message-State: AMCzsaVgr7PKagMd6pg9hJ7CglZinp3yDPKaFyZXCbpinIk87zkKkXho 0uWn7SPovacdPPuFvC5XOKWkEZJmlXo= X-Google-Smtp-Source: AOwi7QC3Z/FY+BnS6jKqPTduZxfObGkI8KKn5gWhXR9qi16D1PYGqj/dHuWDWdJPsyXhBF032pwP3A== X-Received: by 10.159.207.131 with SMTP id z3mr9724184plo.191.1508174803241; Mon, 16 Oct 2017 10:26:43 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:26:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:25:40 -0700 Message-Id: <20171016172609.23422-22-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::22a Subject: [Qemu-devel] [PATCH v6 21/50] tcg: Use pointers in TCGOp->args 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This limits the indexing into tcg_ctx.temps to initial opcode generation time. Signed-off-by: Richard Henderson --- tcg/tcg.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.13.6 Reviewed-by: Emilio G. Cota diff --git a/tcg/tcg.h b/tcg/tcg.h index ccf1bcdaf6..d5bf61b1cf 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -741,24 +741,29 @@ static inline size_t temp_idx(TCGTemp *ts) return n; } +static inline TCGTemp *idx_temp(size_t n) +{ + return n == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[n]; +} + static inline TCGArg temp_arg(TCGTemp *ts) { - return temp_idx(ts); + return (uintptr_t)ts; } static inline TCGTemp *arg_temp(TCGArg a) { - return a == TCG_CALL_DUMMY_ARG ? NULL : &tcg_ctx.temps[a]; + return (TCGTemp *)a; } static inline size_t arg_index(TCGArg a) { - return a; + return temp_idx(arg_temp(a)); } static inline TCGArg index_arg(size_t n) { - return n; + return temp_arg(idx_temp(n)); } static inline TCGArg tcgv_i32_arg(TCGv_i32 t)