goto error;
}
- if (_orc_compiler_flag_emulate) {
- program->code_exec = (void *)orc_executor_emulate;
- compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE;
- goto error;
- }
-
if (target == NULL) {
ORC_COMPILER_ERROR(compiler, "No target given");
compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE;
program->orccode->vars[i].value = compiler->vars[i].value;
}
+ if (_orc_compiler_flag_emulate) {
+ program->code_exec = (void *)orc_executor_emulate;
+ compiler->result = ORC_COMPILE_RESULT_UNKNOWN_COMPILE;
+ goto error;
+ }
+
orc_compiler_assign_rules (compiler);
if (compiler->error) goto error;
memset (&opcode_ex, 0, sizeof(opcode_ex));
+ if (code == NULL) {
+ ORC_ERROR("attempt to run program that failed to compile");
+ ORC_ASSERT(0);
+ }
+
if (code->is_2d) {
m = ORC_EXECUTOR_M(ex);
} else {
} else if (var->vartype == ORC_VAR_TYPE_TEMP) {
opcode_ex[j].src_ptrs[k] = tmpspace[insn->src_args[k]];
} else if (var->vartype == ORC_VAR_TYPE_SRC) {
+ if (((unsigned long)ex->arrays[insn->src_args[k]]) & (var->size - 1)) {
+ ORC_ERROR("Unaligned array for src%d, program %s",
+ (insn->src_args[k]-ORC_VAR_S1), ex->program->name);
+ }
opcode_ex[j].src_ptrs[k] = ex->arrays[insn->src_args[k]];
} else if (var->vartype == ORC_VAR_TYPE_DEST) {
+ if (((unsigned long)ex->arrays[insn->src_args[k]]) & (var->size - 1)) {
+ ORC_ERROR("Unaligned array for dest%d, program %s",
+ (insn->src_args[k]-ORC_VAR_D1), ex->program->name);
+ }
opcode_ex[j].src_ptrs[k] = ex->arrays[insn->src_args[k]];
}
}
opcode_ex[j].dest_ptrs[k] =
&ex->accumulators[insn->dest_args[k] - ORC_VAR_A1];
} else if (var->vartype == ORC_VAR_TYPE_DEST) {
+ if (((unsigned long)ex->arrays[insn->dest_args[k]]) & (var->size - 1)) {
+ ORC_ERROR("Unaligned array for dest%d, program %s",
+ (insn->dest_args[k]-ORC_VAR_D1), ex->program->name);
+ }
opcode_ex[j].dest_ptrs[k] = ex->arrays[insn->dest_args[k]];
}
}
}
free (opcode_ex);
- for(i=0;i<ORC_VAR_T15+1;i++){
+ for(i=0;i<ORC_N_COMPILER_VARIABLES;i++){
if (tmpspace[i]) free (tmpspace[i]);
}
}