[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 2/7] tcg: store ENV global in TCGContext
From: |
Kirill Batuzov |
Subject: |
[Qemu-devel] [PATCH RFC 2/7] tcg: store ENV global in TCGContext |
Date: |
Thu, 16 Oct 2014 12:56:49 +0400 |
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 <address@hidden>
---
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;
--
1.7.10.4
- [Qemu-devel] [PATCH RFC 0/7] Translate guest vector operations to host vector operations, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 2/7] tcg: store ENV global in TCGContext,
Kirill Batuzov <=
- [Qemu-devel] [PATCH RFC 3/7] tcg: add sync_temp opcode, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 5/7] target-arm: support access to 128-bit guest registers as globals, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 1/7] tcg: add support for 128bit vector type, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 7/7] tcg/i386: add support for vector opcodes, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 6/7] target-arm: use add_i32x4 opcode to handle vadd.i32 instruction, Kirill Batuzov, 2014/10/16
- [Qemu-devel] [PATCH RFC 4/7] tcg: add add_i32x4 opcode, Kirill Batuzov, 2014/10/16
- Re: [Qemu-devel] [PATCH RFC 0/7] Translate guest vector operations to host vector operations, Alex Bennée, 2014/10/16