From a94c69f16c1e8f18056393e07c75e9b5860fa678 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 16 May 2011 12:46:04 -0700 Subject: [PATCH] sse: implement aligned arrays --- orc/orcprogram-sse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/orc/orcprogram-sse.c b/orc/orcprogram-sse.c index 43129a9..ff27b5e 100644 --- a/orc/orcprogram-sse.c +++ b/orc/orcprogram-sse.c @@ -768,6 +768,7 @@ orc_compiler_sse_assemble (OrcCompiler *compiler) int set_mxcsr = FALSE; #endif int align_var; + int is_aligned; if (0 && orc_x86_assemble_copy_check (compiler)) { /* The rep movs implementation isn't faster most of the time */ @@ -776,8 +777,7 @@ orc_compiler_sse_assemble (OrcCompiler *compiler) } align_var = get_align_var (compiler); - - compiler->vars[align_var].is_aligned = FALSE; + is_aligned = compiler->vars[align_var].is_aligned; { orc_sse_emit_loop (compiler, 0, 0); @@ -830,11 +830,11 @@ orc_compiler_sse_assemble (OrcCompiler *compiler) compiler->program->constant_n <= ORC_SSE_ALIGNED_DEST_CUTOFF) { /* don't need to load n */ } else if (compiler->loop_shift > 0) { - if (!compiler->has_iterator_opcode) { + if (compiler->has_iterator_opcode || is_aligned) { + orc_emit_split_2_regions (compiler); + } else { /* split n into three regions, with center region being aligned */ orc_emit_split_3_regions (compiler); - } else { - orc_emit_split_2_regions (compiler); } } else { /* loop shift is 0, no need to split */ @@ -879,7 +879,7 @@ orc_compiler_sse_assemble (OrcCompiler *compiler) int emit_region1 = TRUE; int emit_region3 = TRUE; - if (compiler->has_iterator_opcode) { + if (compiler->has_iterator_opcode || is_aligned) { emit_region1 = FALSE; } if (compiler->loop_shift == 0) { -- 2.7.4