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~