tcg.c revision 3d40f685fa5cdd9cb665ae3cbf5f76113dafcb99
2N/A#define USE_LIVENESS_ANALYSIS
2N/A#include <inttypes.h>
2N/A#include "qemu-common.h"
2N/A#include "cache-utils.h"
2N/A#include "host-utils.h"
2N/A#include "qemu-timer.h"
2N/A#define NO_CPU_IO_DEFS
2N/A#include "exec-all.h"
2N/A#define DEF(s, oargs, iargs, cargs, flags) { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags },
2N/A TCGRelocation *r;
2N/A l->u.first_reloc = r;
2N/A TCGRelocation *r;
2N/A r = l->u.first_reloc;
2N/Aint gen_new_label(void)
2N/A#include "tcg-target.c"
2N/A if (s->pool_current)
2N/A s->pool_first = p;
2N/A p = s->pool_current;
2N/A p = s->pool_first;
2N/A if (s->pool_current)
2N/A s->pool_first = p;
2N/A s->pool_current = p;
2N/A int *sorted_args;
2N/A s->nb_globals = 0;
2N/A total_args = 0;
2N/A total_args += n;
2N/A sorted_args += n;
2N/A tcg_target_init(s);
2N/A tcg_pool_reset(s);
2N/A if (n > TCG_MAX_TEMPS)
2N/A s->nb_globals++;
2N/A s->nb_globals++;
2N/A if (temp_local)
2N/A k += TCG_TYPE_COUNT;
2N/A k += TCG_TYPE_COUNT;
2N/A n = s->allocated_helpers;
2N/A s->allocated_helpers = n;
2N/A s->nb_helpers++;
2N/A#ifdef TCG_TARGET_I386
2N/A#ifdef TCG_TARGET_I386
2N/A#ifdef TCG_TARGET_I386
2N/A for(i = 0; i < s->nb_globals; i++) {
2N/A for(i = 0; i < TCG_TARGET_NB_REGS; i++) {
2N/A if (c == INDEX_op_debug_insn_start) {
2N/A if (!first_insn)
2N/A first_insn = 0;
2N/A } else if (c == INDEX_op_call) {
2N/A } else if (c == INDEX_op_movi_i32
2N/A || c == INDEX_op_movi_i64
2N/A if (c == INDEX_op_movi_i32)
2N/A if (c == INDEX_op_nopn) {
2N/A case INDEX_op_brcond_i32:
2N/A case INDEX_op_brcond2_i32:
2N/A case INDEX_op_brcond_i64:
2N/A case INDEX_op_setcond_i32:
2N/A case INDEX_op_setcond2_i32:
2N/A case INDEX_op_setcond_i64:
2N/A for(i = 0; i < TCG_TARGET_NB_REGS; i++) {
2N/A#if defined(CONFIG_DEBUG_TCG)
2N/A#if defined(CONFIG_DEBUG_TCG)
2N/A#ifdef USE_LIVENESS_ANALYSIS
2N/A dead_temps[i] = 0;
2N/A unsigned int dead_iargs;
2N/A case INDEX_op_call:
2N/A int call_flags;
2N/A goto do_not_remove_call;
2N/A dead_iargs = 0;
args--;
case INDEX_op_set_label:
args--;
case INDEX_op_nopn:
case INDEX_op_discard:
args--;
case INDEX_op_end:
for(i = 0; i < nb_oargs; i++) {
goto do_not_remove;
#ifdef CONFIG_PROFILER
s->del_op_count++;
for(i = 0; i < nb_oargs; i++) {
dead_iargs = 0;
for(i = 0; i < nb_iargs; i++) {
op_index--;
tcg_abort();
int nb_ops;
#ifndef NDEBUG
for(i = 0; i < s->nb_temps; i++) {
case TEMP_VAL_REG:
case TEMP_VAL_MEM:
case TEMP_VAL_CONST:
case TEMP_VAL_DEAD:
for(i = 0; i < TCG_TARGET_NB_REGS; i++) {
if (s->reg_to_temp[i] >= 0) {
int reg, k;
goto fail;
for(k = 0; k < s->nb_temps; k++) {
fail:
dump_regs(s);
tcg_abort();
s->current_frame_offset = (s->current_frame_offset + sizeof(tcg_target_long) - 1) & ~(sizeof(tcg_target_long) - 1);
#ifndef VBOX
tcg_abort();
int temp;
int i, reg;
return reg;
return reg;
tcg_abort();
int reg;
case TEMP_VAL_REG:
case TEMP_VAL_DEAD:
case TEMP_VAL_CONST:
case TEMP_VAL_MEM:
tcg_abort();
for(i = 0; i < s->nb_globals; i++) {
unsigned int dead_iargs)
int reg;
tcg_abort();
unsigned int dead_iargs)
for(k = 0; k < nb_iargs; k++) {
goto iarg_end;
goto allocate_in_reg;
goto allocate_in_reg;
const_args[i] = 0;
iarg_end: ;
for(i = 0; i < nb_iargs; i++) {
if (IS_DEAD_IARG(i)) {
for(k = 0; k < nb_oargs; k++) {
goto oarg_end;
for(i = 0; i < nb_oargs; i++) {
#ifdef TCG_TARGET_STACK_GROWSUP
#define STACK_DIR(x) (-(x))
#define STACK_DIR(x) (x)
unsigned int dead_iargs)
if (allocate_args) {
#ifdef TCG_TARGET_STACK_GROWSUP
s->reserved_regs);
s->reserved_regs);
tcg_abort();
#ifndef TCG_TARGET_STACK_GROWSUP
for(i = 0; i < nb_regs; i++) {
tcg_abort();
const_func_arg = 0;
tcg_abort();
for(i = 0; i < nb_iargs; i++) {
if (IS_DEAD_IARG(i)) {
if (allocate_args) {
for(i = 0; i < nb_oargs; i++) {
#ifdef CONFIG_PROFILER
static void dump_op_count(void)
FILE *f;
fclose(f);
int op_index;
unsigned int dead_iargs;
#ifdef DEBUG_DISAS
#ifdef CONFIG_PROFILER
#ifdef CONFIG_PROFILER
#ifdef DEBUG_DISAS
op_index = 0;
#ifdef CONFIG_PROFILER
switch(opc) {
case INDEX_op_mov_i32:
case INDEX_op_mov_i64:
case INDEX_op_movi_i32:
case INDEX_op_movi_i64:
case INDEX_op_nop:
case INDEX_op_nop1:
case INDEX_op_nop2:
case INDEX_op_nop3:
case INDEX_op_nopn:
goto next;
case INDEX_op_discard:
case INDEX_op_set_label:
case INDEX_op_call:
goto next;
case INDEX_op_end:
goto the_end;
next:
return op_index;
op_index++;
#ifndef NDEBUG
check_regs(s);
#ifdef CONFIG_PROFILER
s->op_count += n;
if (n > s->op_count_max)
s->op_count_max = n;
#ifdef CONFIG_PROFILER
s->tb_count,
s->tb_count ?
s->tb_count ?
s->temp_count_max);
if (tot == 0)
s->restore_count);