From 72f77fcc69cb0f0da4f5722da35fccadc93211df Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Wed, 5 Jun 2013 21:50:26 +0200 Subject: [PATCH] accumulator: use the local variable 'var' The code already had the local var, but barely used it. --- orc/orcprogram-mmx.c | 14 +++++++------- orc/orcprogram-sse.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/orc/orcprogram-mmx.c b/orc/orcprogram-mmx.c index c921b60..432992b 100644 --- a/orc/orcprogram-mmx.c +++ b/orc/orcprogram-mmx.c @@ -279,10 +279,10 @@ mmx_save_accumulators (OrcCompiler *compiler) for(i=0;ivars + i; - if (compiler->vars[i].name == NULL) continue; - switch (compiler->vars[i].vartype) { + if (var->name == NULL) continue; + switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: - src = compiler->vars[i].alloc; + src = var->alloc; tmp = orc_compiler_get_temp_reg (compiler); #ifndef MMX @@ -291,7 +291,7 @@ mmx_save_accumulators (OrcCompiler *compiler) orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_mmx_emit_paddw (compiler, tmp, src); } else { orc_mmx_emit_paddd (compiler, tmp, src); @@ -300,14 +300,14 @@ mmx_save_accumulators (OrcCompiler *compiler) #ifndef MMX orc_mmx_emit_pshufd (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_mmx_emit_paddw (compiler, tmp, src); } else { orc_mmx_emit_paddd (compiler, tmp, src); } #endif - if (compiler->vars[i].size == 2) { + if (var->size == 2) { #ifndef MMX orc_mmx_emit_pshuflw (compiler, ORC_MMX_SHUF(1,1,1,1), src, tmp); #else @@ -317,7 +317,7 @@ mmx_save_accumulators (OrcCompiler *compiler) orc_mmx_emit_paddw (compiler, tmp, src); } - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_mmx_emit_movd_store_register (compiler, src, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, diff --git a/orc/orcprogram-sse.c b/orc/orcprogram-sse.c index 2ed9062..ac2fce3 100644 --- a/orc/orcprogram-sse.c +++ b/orc/orcprogram-sse.c @@ -279,10 +279,10 @@ sse_save_accumulators (OrcCompiler *compiler) for(i=0;ivars + i; - if (compiler->vars[i].name == NULL) continue; - switch (compiler->vars[i].vartype) { + if (var->name == NULL) continue; + switch (var->vartype) { case ORC_VAR_TYPE_ACCUMULATOR: - src = compiler->vars[i].alloc; + src = var->alloc; tmp = orc_compiler_get_temp_reg (compiler); #ifndef MMX @@ -291,7 +291,7 @@ sse_save_accumulators (OrcCompiler *compiler) orc_mmx_emit_pshufw (compiler, ORC_MMX_SHUF(3,2,3,2), src, tmp); #endif - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_sse_emit_paddw (compiler, tmp, src); } else { orc_sse_emit_paddd (compiler, tmp, src); @@ -300,14 +300,14 @@ sse_save_accumulators (OrcCompiler *compiler) #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(1,1,1,1), src, tmp); - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_sse_emit_paddw (compiler, tmp, src); } else { orc_sse_emit_paddd (compiler, tmp, src); } #endif - if (compiler->vars[i].size == 2) { + if (var->size == 2) { #ifndef MMX orc_sse_emit_pshuflw (compiler, ORC_SSE_SHUF(1,1,1,1), src, tmp); #else @@ -317,7 +317,7 @@ sse_save_accumulators (OrcCompiler *compiler) orc_sse_emit_paddw (compiler, tmp, src); } - if (compiler->vars[i].size == 2) { + if (var->size == 2) { orc_sse_emit_movd_store_register (compiler, src, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, -- 2.7.4