summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Emont <guijemont@igalia.com>2012-12-21 14:04:56 +0100
committerGuillaume Emont <guijemont@igalia.com>2012-12-28 15:23:39 +0100
commit10bbf2ccf9fdd9f34cc9a36c25516a104f0fd63c (patch)
tree8249b182372123a86449096340dfcddcfb4f0eb0
parent097221af38a1432078a1690a43cb15e73bf6524b (diff)
mips: fixed prefetching instruction calculation, but deactivated prefetching for now (no measurable performance improvements)
-rw-r--r--orc/orcprogram-mips.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/orc/orcprogram-mips.c b/orc/orcprogram-mips.c
index b1a5498..17a482c 100644
--- a/orc/orcprogram-mips.c
+++ b/orc/orcprogram-mips.c
@@ -323,21 +323,21 @@ orc_mips_emit_var_pref (OrcCompiler *compiler, int iter_offset, int total_shift)
OrcVariable *var = compiler->vars + i;
if (var->name == NULL) continue;
+ if (var->update_type == 0) {
+ offset = 0;
+ } else if (var->update_type == 1) {
+ offset = (var->size << total_shift) >> 1;
+ } else {
+ offset = var->size << total_shift;
+ }
if (var->vartype == ORC_VAR_TYPE_SRC) {
- if (var->update_type == 0) {
- offset = 0;
- } else if (var->update_type == 1) {
- offset = (var->size << total_shift) >> 1;
- } else {
- offset = var->size << total_shift;
- }
for (j = iter_offset*offset; j < (iter_offset+1)*offset; j+=CACHE_LINE_SIZE)
orc_mips_emit_pref (compiler, 4 /* load-streamed */,
- var->ptr_register, iter_offset * offset + j*CACHE_LINE_SIZE);
+ var->ptr_register, j);
} else if (var->vartype == ORC_VAR_TYPE_DEST) {
for (j = iter_offset*offset; j < (iter_offset+1)*offset; j+=CACHE_LINE_SIZE)
orc_mips_emit_pref (compiler, 5 /* store-streamed */,
- var->ptr_register, iter_offset * offset + j*CACHE_LINE_SIZE);
+ var->ptr_register, j);
}
}
}
@@ -360,8 +360,6 @@ orc_mips_emit_loop (OrcCompiler *compiler, int unroll)
if (unroll)
iteration_per_loop = 1 << compiler->unroll_shift;
- orc_mips_emit_var_pref (compiler, 1, total_shift);
-
for (j=0; j<iteration_per_loop; j++) {
compiler->unroll_index = j;
for (i=0; i<compiler->n_insns; i++) {
@@ -478,7 +476,6 @@ orc_mips_emit_full_loop (OrcCompiler *compiler, OrcMipsRegister counter,
compiler->loop_shift = loop_shift;
saved_alignment = orc_mips_get_alignment (compiler);
orc_mips_set_alignment (compiler, alignment);
- orc_mips_emit_var_pref (compiler, 0, compiler->loop_shift + unroll * compiler->unroll_shift);
orc_mips_emit_loop (compiler, unroll);
orc_mips_set_alignment (compiler, saved_alignment);
compiler->loop_shift = saved_loop_shift;