Remove temp_buf, rename CPU_TEMP_BUF_NLONGS
PATCH 18/18 Remove temp_buf, rename CPU_TEMP_BUF_NLONGS
Remove now unused temp_buf from CPUState. Rename CPU_TEMP_BUF_NLONGS to TCG_TEMP_BUF_NLONGS.
--- cpu-defs.h | 3 --- tcg/arm/tcg-target.c | 6 +++--- tcg/hppa/tcg-target.c | 4 ++-- tcg/i386/tcg-target.c | 4 ++-- tcg/ia64/tcg-target.c | 4 ++-- tcg/mips/tcg-target.c | 6 +++--- tcg/ppc/tcg-target.c | 6 +++--- tcg/ppc64/tcg-target.c | 6 +++--- tcg/s390/tcg-target.c | 4 ++-- tcg/sparc/tcg-target.c | 4 ++-- tcg/tcg.h | 3 +++ 11 files changed, 25 insertions(+), 25 deletions(-)
cpu-defs.h +0 -3
@@ -153,7 +153,6 @@ typedef struct CPUWatchpoint {QTAILQ_ENTRY (CPUWatchpoint) entry; } CPUWatchpoint; -#define CPU_TEMP_BUF_NLONGS 128#define CPU_COMMON \ struct TranslationBlock *current_tb;/* currently executing TB */ \/* soft mmu support */ \
@@ -169,8 +168,6 @@ typedef struct CPUWatchpoint {volatile sig_atomic_t exit_request; \CPU_COMMON_TLB \ struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE]; \ -/* buffer for temporaries in the code generator */ \ -long temp_buf[CPU_TEMP_BUF_NLONGS ]; \ \int64_t icount_extra;/* Instructions until next timer event. */ \/* Number of cycles left, with interrupt flag in high bit. \
tcg/arm/tcg-target.c +0 -0
@@ -1847,7 +1847,7 @@ static inline void tcg_out_movi(TCGContext *s,
TCGType type,
static void tcg_target_qemu_prologue(TCGContext *s)
{
tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE,
- CPU_TEMP_BUF_NLONGS * sizeof(long));
+ TCG_TEMP_BUF_NLONGS * sizeof(long));
/* Calling convention requires us to save r4-r11 and lr;
* save also r12 to maintain stack 8-alignment.
@@ -1857,7 +1857,7 @@ static void tcg_target_qemu_prologue(TCGContext *s)
tcg_out32(s, (COND_AL << 28) | 0x092d5ff0);
tcg_out_addi(s, TCG_REG_CALL_STACK, -TCG_STATIC_CALL_ARGS_SIZE -
- CPU_TEMP_BUF_NLONGS * sizeof(long)));
+ TCG_TEMP_BUF_NLONGS * sizeof(long)));
tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]);
@@ -1865,7 +1865,7 @@ static void tcg_target_qemu_prologue(TCGContext *s)
tb_ret_addr = s->code_ptr;
tcg_out_addi(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE +
- CPU_TEMP_BUF_NLONGS * sizeof(long));
+ TCG_TEMP_BUF_NLONGS * sizeof(long));
/* ldmia sp!, { r4 - r12, pc } */
tcg_out32(s, (COND_AL << 28) | 0x08bd9ff0);tcg/hppa/tcg-target.c +2 -2
@@ -1614,8 +1614,8 @@ static void tcg_target_qemu_prologue(TCGContext *s)/* Use the space here for the TCG temps. */ tcg_set_frame (s,TCG_REG_CALL_STACK , frame_size, -CPU_TEMP_BUF_NLONGS *sizeof (long )); - frame_size +=CPU_TEMP_BUF_NLONGS *sizeof (long ); +TCG_TEMP_BUF_NLONGS *sizeof (long )); + frame_size +=TCG_TEMP_BUF_NLONGS *sizeof (long );/* Align the allocated space. */ frame_size = ((frame_size + TCG_TARGET_STACK_ALIGN - 1)
tcg/i386/tcg-target.c +2 -2
@@ -1923,12 +1923,12 @@ static void tcg_target_qemu_prologue(TCGContext *s) push_size *=TCG_TARGET_REG_BITS /8 ; frame_size = push_size +TCG_STATIC_CALL_ARGS_SIZE + -CPU_TEMP_BUF_NLONGS *sizeof (long ); +TCG_TEMP_BUF_NLONGS *sizeof (long ); frame_size = (frame_size +TCG_TARGET_STACK_ALIGN -1 ) & ~(TCG_TARGET_STACK_ALIGN -1 ); stack_addend = frame_size - push_size;tcg_set_frame (s,TCG_REG_CALL_STACK ,TCG_STATIC_CALL_ARGS_SIZE , -CPU_TEMP_BUF_NLONGS *sizeof (long )); +TCG_TEMP_BUF_NLONGS *sizeof (long ));/* Save all callee saved registers. */ for (i =0 ; i <ARRAY_SIZE (tcg_target_callee_save_regs); i++) {
tcg/ia64/tcg-target.c +2 -2
@@ -2280,13 +2280,13 @@ static void tcg_target_qemu_prologue(TCGContext *s)/* reserve some stack space */ frame_size =TCG_STATIC_CALL_ARGS_SIZE + -CPU_TEMP_BUF_NLONGS *sizeof (long ); +TCG_TEMP_BUF_NLONGS *sizeof (long ); frame_size = (frame_size +TCG_TARGET_STACK_ALIGN -1 ) & ~(TCG_TARGET_STACK_ALIGN -1 );tcg_set_frame (s,TCG_REG_CALL_STACK ,TCG_STATIC_CALL_ARGS_SIZE , -CPU_TEMP_BUF_NLONGS *sizeof (long )); +TCG_TEMP_BUF_NLONGS *sizeof (long ));/* First emit adhoc function descriptor */ *(uint64_t *)(s->code_ptr) = (uint64_t )s->code_ptr +16 ;/* entry point */
tcg/mips/tcg-target.c +3 -3
@@ -1472,12 +1472,12 @@ static void tcg_target_qemu_prologue(TCGContext *s)/* reserve some stack space */ frame_size =ARRAY_SIZE (tcg_target_callee_save_regs) *4 - +TCG_STATIC_CALL_ARGS_SIZE +CPU_TEMP_BUF_NLONGS *sizeof (long ); + +TCG_STATIC_CALL_ARGS_SIZE +TCG_TEMP_BUF_NLONGS *sizeof (long ); frame_size = (frame_size +TCG_TARGET_STACK_ALIGN -1 ) & ~(TCG_TARGET_STACK_ALIGN -1 );tcg_set_frame (s,TCG_REG_CALL_STACK , frame_size - -CPU_TEMP_BUF_NLONGS *sizeof (long ), -CPU_TEMP_BUF_NLONGS *sizeof (long )); + -TCG_TEMP_BUF_NLONGS *sizeof (long ), +TCG_TEMP_BUF_NLONGS *sizeof (long ));/* TB prologue */ tcg_out_addi (s,TCG_REG_CALL_STACK , -frame_size);
tcg/ppc/tcg-target.c +3 -3
@@ -907,13 +907,13 @@ static void tcg_target_qemu_prologue (TCGContext *s) +LINKAGE_AREA_SIZE +TCG_STATIC_CALL_ARGS_SIZE +ARRAY_SIZE (tcg_target_callee_save_regs) *4 - +CPU_TEMP_BUF_NLONGS *sizeof (long ) + +TCG_TEMP_BUF_NLONGS *sizeof (long ) ; frame_size = (frame_size +15 ) & ~15 ;tcg_set_frame (s,TCG_REG_CALL_STACK , frame_size - -CPU_TEMP_BUF_NLONGS *sizeof (long ), -CPU_TEMP_BUF_NLONGS *sizeof (long )); + -TCG_TEMP_BUF_NLONGS *sizeof (long ), +TCG_TEMP_BUF_NLONGS *sizeof (long ));#ifdef _CALL_AIX {
tcg/ppc64/tcg-target.c +3 -3
@@ -875,13 +875,13 @@ static void tcg_target_qemu_prologue (TCGContext *s) +8 /* TOC save area */ +TCG_STATIC_CALL_ARGS_SIZE +ARRAY_SIZE (tcg_target_callee_save_regs) *8 - +CPU_TEMP_BUF_NLONGS *sizeof (long ) + +TCG_TEMP_BUF_NLONGS *sizeof (long ) ; frame_size = (frame_size +15 ) & ~15 ;tcg_set_frame (s,TCG_REG_CALL_STACK , frame_size - -CPU_TEMP_BUF_NLONGS *sizeof (long ), -CPU_TEMP_BUF_NLONGS *sizeof (long )); + -TCG_TEMP_BUF_NLONGS *sizeof (long ), +TCG_TEMP_BUF_NLONGS *sizeof (long ));#ifndef __APPLE__/* First emit adhoc function descriptor */
tcg/s390/tcg-target.c +2 -2
@@ -2301,10 +2301,10 @@ static void tcg_target_qemu_prologue(TCGContext *s)/* aghi %r15,-160 (stack frame) */ tcg_out_insn (s,RI ,AGHI ,TCG_REG_CALL_STACK , - -(160 +CPU_TEMP_BUF_NLONGS *sizeof (long ))); + -(160 +TCG_TEMP_BUF_NLONGS *sizeof (long )));tcg_set_frame (s,TCG_REG_CALL_STACK ,160 , -CPU_TEMP_BUF_NLONGS *sizeof (long )); +TCG_TEMP_BUF_NLONGS *sizeof (long ));if (GUEST_BASE >=0x80000 ) {tcg_out_movi (s,TCG_TYPE_PTR ,TCG_GUEST_BASE_REG ,GUEST_BASE );tcg_regset_set_reg (s->reserved_regs,TCG_GUEST_BASE_REG );
tcg/sparc/tcg-target.c +0 -0
@@ -694,10 +694,10 @@ static void tcg_out_setcond2_i32(TCGContext *s,
TCGCond cond, TCGArg ret,
static void tcg_target_qemu_prologue(TCGContext *s) {
tcg_set_frame(s, TCG_REG_I6, TCG_TARGET_CALL_STACK_OFFSET,
- CPU_TEMP_BUF_NLONGS * (int)sizeof(long));
+ TCG_TEMP_BUF_NLONGS * (int)sizeof(long));
tcg_out32(s, SAVE | INSN_RD(TCG_REG_O6) | INSN_RS1(TCG_REG_O6) |
INSN_IMM13(-(TCG_TARGET_STACK_MINFRAME +
- CPU_TEMP_BUF_NLONGS * (int)sizeof(long))));
+ TCG_TEMP_BUF_NLONGS * (int)sizeof(long))));
tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(TCG_REG_I1) |
INSN_RS2(TCG_REG_G0));
tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, TCG_REG_I0);tcg/tcg.h +3 -0
@@ -92,6 +92,9 @@ typedef struct TCGPool {#define TCG_MAX_TEMPS 512 +/* buffer for temporaries */ +#define TCG_TEMP_BUF_NLONGS 128 +/* when the size of the arguments of a called function is smaller than this value, they are statically allocated in the TB stack frame */ #define TCG_STATIC_CALL_ARGS_SIZE 128
Signature · 1 line
1.6.2.4