}
compiler->unroll_shift = 0;
+ //compiler->alloc_loop_counter = TRUE;
}
(int)ORC_STRUCT_OFFSET(OrcExecutor,counter2), compiler->exec_reg);
orc_x86_emit_je (compiler, LABEL_REGION2_SKIP);
+ if (compiler->loop_counter != ORC_REG_INVALID) {
+ orc_x86_emit_mov_memoffset_reg (compiler, 4,
+ (int)ORC_STRUCT_OFFSET(OrcExecutor, counter2), compiler->exec_reg,
+ compiler->loop_counter);
+ }
+
ORC_ASM_CODE(compiler, "# LOOP SHIFT %d\n", compiler->loop_shift);
orc_x86_emit_align (compiler);
orc_x86_emit_label (compiler, LABEL_INNER_LOOP_START);
orc_sse_emit_loop (compiler, ui<<compiler->loop_shift,
(ui==ui_max-1) << (compiler->loop_shift + compiler->unroll_shift));
}
- orc_x86_emit_dec_memoffset (compiler, 4,
- (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2),
- compiler->exec_reg);
+ if (compiler->loop_counter != ORC_REG_INVALID) {
+ orc_x86_emit_add_imm_reg (compiler, 4, -1, compiler->loop_counter);
+ } else {
+ orc_x86_emit_dec_memoffset (compiler, 4,
+ (int)ORC_STRUCT_OFFSET(OrcExecutor,counter2),
+ compiler->exec_reg);
+ }
orc_x86_emit_jne (compiler, LABEL_INNER_LOOP_START);
orc_x86_emit_label (compiler, LABEL_REGION2_SKIP);
#define ORC_GP_REG_BASE 32
#define ORC_VEC_REG_BASE 64
+#define ORC_REG_INVALID 0
#define ORC_STATIC_OPCODE_N_SRC 4
#define ORC_STATIC_OPCODE_N_DEST 2
int insn_index;
int need_mask_regs;
int unroll_shift;
+
+ int alloc_loop_counter;
+ int loop_counter;
};
#define ORC_SRC_ARG(p,i,n) ((p)->vars[(i)->src_args[(n)]].alloc)