qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 06/16] tcg: Add temp_global bit to TCGTemp


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 06/16] tcg: Add temp_global bit to TCGTemp
Date: Tue, 27 Jun 2017 09:17:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0

On 06/27/2017 01:39 AM, Alex Bennée wrote:
+    /* If true, the temp is saved across both basic blocks and
+       translation blocks.  */
+    unsigned int temp_global:1;
+    /* If true, the temp is saved across basic blocks but dead
+       at the end of translation blocks.  If false, the temp is
+       dead at the end of basic blocks.  */
+    unsigned int temp_local:1;
+    unsigned int temp_allocated:1;

This is where my knowledge of the TCG internals gets slightly confused.
As far as I'm aware all our TranslationBlocks are Basic Blocks - they
don't have any branches until the end of the block. What is the
distinction here?

Is a temp_global truly global? I thought the guest state was fully
rectified by the time we leave the basic block.

TranslationBlocks are not basic blocks. They normally stop at branches in the target instruction stream, but they certainly may have many branches in the tcg opcode stream (brcond and the like). Consider, for instance, our implementation of arm32's conditional instructions.

Beyond that, I agree the language is confusing.

A temp_global is created by tcg_global_mem_new_*, generally represents a cpu register, and is synced back to a slot in ENV.

A temp_local is created by tcg_temp_local_new_*, and is synced to a slot in the local stack frame.

Something without either is simply declared dead at the end of a basic block, and is a source of confusion to those writing new front-ends.

Anyway, we already have all of these concepts. The change is that before the patch the only way to tell a temp_global is to compare the index against tcg_ctx.nb_global.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]