From patchwork Thu Oct 16 08:56:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Batuzov X-Patchwork-Id: 400226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1857E1400D6 for ; Thu, 16 Oct 2014 19:57:53 +1100 (AEDT) Received: from localhost ([::1]:49284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XegsY-0002KH-KX for incoming@patchwork.ozlabs.org; Thu, 16 Oct 2014 04:57:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xegrw-0001Y4-VH for qemu-devel@nongnu.org; Thu, 16 Oct 2014 04:57:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xegrq-0006Uk-UD for qemu-devel@nongnu.org; Thu, 16 Oct 2014 04:57:12 -0400 Received: from smtp.ispras.ru ([83.149.199.79]:49270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xegrq-0006UC-N5 for qemu-devel@nongnu.org; Thu, 16 Oct 2014 04:57:06 -0400 Received: from bulbul.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 0B173224AE; Thu, 16 Oct 2014 12:57:06 +0400 (MSK) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Thu, 16 Oct 2014 12:56:49 +0400 Message-Id: <0ad225dd3634c8432916bcbf6ada30fb38478a2c.1413286807.git.batuzovk@ispras.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: <87k3571pb5.fsf@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 83.149.199.79 Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kirill Batuzov Subject: [Qemu-devel] [PATCH RFC 2/7] tcg: store ENV global in TCGContext 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When a TCG backend does not support some vector operation we need to emulate this operation. Unlike arguments of the scalar operations vector values are hard to operate on directly or to be passed as function arguments (because a target may lack corresponding type support). To avoid this we will use pointers to host memory locations holding values of temporaries. This memory locations for globals must be their canonical locations in CPUArchState because moving them around is expensive and hard to implement. Fortunately globals always have memory locations statically assigned to them. They are addressed relative to AREG0. To express direct access to this memory in TCG opcodes we need to know global variable ENV (which corresponds to this AREG0). Add a field to TCGContext. Frontends can save ENV there during translate_init. It will be used in handling vector operations only so targets that do not use vector support do not need to set it. Signed-off-by: Kirill Batuzov --- tcg/tcg.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tcg/tcg.h b/tcg/tcg.h index 01dbede..83fb0d3 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -496,6 +496,7 @@ struct TCGContext { tcg_insn_unit *code_ptr; TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */ TCGTempSet free_temps[TCG_TYPE_COUNT * 2]; + TCGv_ptr cpu_env; /* used to access memory locations for vector globals */ GHashTable *helpers;