From: David Schleef Date: Wed, 11 Aug 2010 06:30:19 +0000 (-0700) Subject: Make sure there are enough registers for temps X-Git-Tag: orc-0.4.7~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6af46fd62bf1ec5baeb734167dd8f2a4eae17b94;p=platform%2Fupstream%2Forc.git Make sure there are enough registers for temps --- diff --git a/orc/orccompiler.c b/orc/orccompiler.c index 91ecc59..71df817 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -587,7 +587,8 @@ orc_compiler_get_temp_reg (OrcCompiler *compiler) } } - ORC_DEBUG("at insn %d", compiler->insn_index); + ORC_DEBUG("at insn %d %s", compiler->insn_index, + compiler->insns[compiler->insn_index].opcode->name); for(j=0;j<8;j++){ ORC_DEBUG("xmm%d: %d %d", j, compiler->valid_regs[ORC_VEC_REG_BASE + j], compiler->alloc_regs[ORC_VEC_REG_BASE + j]); @@ -596,6 +597,7 @@ orc_compiler_get_temp_reg (OrcCompiler *compiler) for(j=compiler->min_temp_reg;jvalid_regs[j] && !compiler->alloc_regs[j]) { compiler->min_temp_reg = j+1; + if (compiler->max_used_temp_reg < j) compiler->max_used_temp_reg = j; return j; } } @@ -1001,13 +1003,16 @@ orc_compiler_get_constant_reg (OrcCompiler *compiler) compiler->alloc_regs[compiler->constants[j].alloc_reg] = 1; } } + for(j=ORC_VEC_REG_BASE;j<=compiler->max_used_temp_reg;j++) { + compiler->alloc_regs[j] = 1; + } for(j=0;j<8;j++){ ORC_DEBUG("xmm%d: %d %d", j, compiler->valid_regs[ORC_VEC_REG_BASE + j], compiler->alloc_regs[ORC_VEC_REG_BASE + j]); } - for(j=compiler->min_temp_reg;jmax_used_temp_reg;jvalid_regs[j] && !compiler->alloc_regs[j]) { return j; } diff --git a/orc/orcprogram.h b/orc/orcprogram.h index 5586534..44b8c78 100644 --- a/orc/orcprogram.h +++ b/orc/orcprogram.h @@ -432,6 +432,7 @@ struct _OrcCompiler { int offset; int min_temp_reg; + int max_used_temp_reg; }; #define ORC_SRC_ARG(p,i,n) ((p)->vars[(i)->src_args[(n)]].alloc)