#include <orc/orcprogram.h>
#include <orc/orcdebug.h>
+#include <orc/orcinternal.h>
#ifdef HAVE_VALGRIND_VALGRIND_H
#include <valgrind/valgrind.h>
va_end (var_args);
}
+void
+orc_compiler_emit_invariants (OrcCompiler *compiler)
+{
+ int j;
+ OrcInstruction *insn;
+ OrcStaticOpcode *opcode;
+ OrcRule *rule;
+
+ for(j=0;j<compiler->n_insns;j++){
+ insn = compiler->insns + j;
+ opcode = insn->opcode;
+
+ if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue;
+
+ ORC_ASM_CODE(compiler,"# %d: %s\n", j, opcode->name);
+
+ compiler->insn_shift = compiler->loop_shift;
+ if (insn->flags & ORC_INSTRUCTION_FLAG_X2) {
+ compiler->insn_shift += 1;
+ }
+ if (insn->flags & ORC_INSTRUCTION_FLAG_X4) {
+ compiler->insn_shift += 2;
+ }
+
+ rule = insn->rule;
+ if (rule && rule->emit) {
+ rule->emit (compiler, rule->emit_user, insn);
+ } else {
+ orc_compiler_error (compiler, "no code generation rule for %s",
+ opcode->name);
+ }
+ }
+}
extern int _orc_cpu_stepping;
extern const char *_orc_cpu_name;
+void orc_compiler_emit_invariants (OrcCompiler *compiler);
#endif
ORC_END_DECLS
#include <orc/orcmips.h>
#include <orc/orcdebug.h>
+#include <orc/orcinternal.h>
#include <stdlib.h>
#include <string.h>
orc_mips_emit_move (compiler, var->ptr_offset, ORC_MIPS_ZERO);
}
-
- for(i=0;i<compiler->n_insns;i++){
- OrcInstruction *insn = compiler->insns + i;
- OrcStaticOpcode *opcode = insn->opcode;
- OrcRule *rule;
-
- if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue;
-
- ORC_ASM_CODE(compiler,"# %d: %s\n", i, insn->opcode->name);
-
- compiler->insn_shift = compiler->loop_shift;
- if (insn->flags & ORC_INSTRUCTION_FLAG_X2) {
- compiler->insn_shift += 1;
- }
- if (insn->flags & ORC_INSTRUCTION_FLAG_X4) {
- compiler->insn_shift += 2;
- }
-
- rule = insn->rule;
- if (rule && rule->emit) {
- rule->emit (compiler, rule->emit_user, insn);
- } else {
- ORC_COMPILER_ERROR(compiler,"No rule for: %s", opcode->name);
- }
- }
+ orc_compiler_emit_invariants (compiler);
}
#define CACHE_LINE_SIZE 32
#include <orc/orcmmx.h>
#include <orc/orcutils.h>
#include <orc/orcdebug.h>
+#include <orc/orcinternal.h>
#define MMX 1
#define SIZE 65536
static unsigned int orc_compiler_mmx_get_default_flags (void);
static void orc_compiler_mmx_assemble (OrcCompiler *compiler);
extern void orc_compiler_mmx_register_rules (OrcTarget *target);
-static void orc_mmx_emit_invariants (OrcCompiler *compiler);
void mmx_load_constant (OrcCompiler *compiler, int reg, int size, int value);
void mmx_load_constant_long (OrcCompiler *compiler, int reg,
}
}
- orc_mmx_emit_invariants (compiler);
+ orc_compiler_emit_invariants (compiler);
/* FIXME move to a better place */
for(i=0;i<compiler->n_constants;i++){
}
}
}
-
-static void
-orc_mmx_emit_invariants (OrcCompiler *compiler)
-{
- int j;
- OrcInstruction *insn;
- OrcStaticOpcode *opcode;
- OrcRule *rule;
-
- for(j=0;j<compiler->n_insns;j++){
- insn = compiler->insns + j;
- opcode = insn->opcode;
-
- if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue;
-
- ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name);
-
- compiler->insn_shift = compiler->loop_shift;
- if (insn->flags & ORC_INSTRUCTION_FLAG_X2) {
- compiler->insn_shift += 1;
- }
- if (insn->flags & ORC_INSTRUCTION_FLAG_X4) {
- compiler->insn_shift += 2;
- }
-
- rule = insn->rule;
- if (rule && rule->emit) {
- rule->emit (compiler, rule->emit_user, insn);
- } else {
- orc_compiler_error (compiler, "no code generation rule for %s",
- opcode->name);
- }
- }
-}
-
#include <orc/orcarm.h>
#include <orc/orcutils.h>
#include <orc/orcdebug.h>
+#include <orc/orcinternal.h>
#include <orc/orcneon.h>
}
}
- for(i=0;i<compiler->n_insns;i++){
- OrcInstruction *insn = compiler->insns + i;
- OrcStaticOpcode *opcode = insn->opcode;
- OrcRule *rule;
-
- if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue;
-
- ORC_ASM_CODE(compiler,"# %d: %s\n", i, insn->opcode->name);
-
- compiler->insn_shift = compiler->loop_shift;
- if (insn->flags & ORC_INSTRUCTION_FLAG_X2) {
- compiler->insn_shift += 1;
- }
- if (insn->flags & ORC_INSTRUCTION_FLAG_X4) {
- compiler->insn_shift += 2;
- }
-
- rule = insn->rule;
- if (rule && rule->emit) {
- rule->emit (compiler, rule->emit_user, insn);
- } else {
- ORC_COMPILER_ERROR(compiler,"No rule for: %s", opcode->name);
- }
- }
+ orc_compiler_emit_invariants (compiler);
}
static void
#include <orc/orcsse.h>
#include <orc/orcutils.h>
#include <orc/orcdebug.h>
+#include <orc/orcinternal.h>
#undef MMX
#define SIZE 65536
static void orc_compiler_sse_init (OrcCompiler *compiler);
static unsigned int orc_compiler_sse_get_default_flags (void);
static void orc_compiler_sse_assemble (OrcCompiler *compiler);
-static void orc_sse_emit_invariants (OrcCompiler *compiler);
void sse_load_constant (OrcCompiler *compiler, int reg, int size, int value);
void sse_load_constant_long (OrcCompiler *compiler, int reg,
}
}
- orc_sse_emit_invariants (compiler);
+ orc_compiler_emit_invariants (compiler);
/* FIXME move to a better place */
for(i=0;i<compiler->n_constants;i++){
}
}
}
-
-static void
-orc_sse_emit_invariants (OrcCompiler *compiler)
-{
- int j;
- OrcInstruction *insn;
- OrcStaticOpcode *opcode;
- OrcRule *rule;
-
- for(j=0;j<compiler->n_insns;j++){
- insn = compiler->insns + j;
- opcode = insn->opcode;
-
- if (!(insn->flags & ORC_INSN_FLAG_INVARIANT)) continue;
-
- ORC_ASM_CODE(compiler,"# %d: %s\n", j, insn->opcode->name);
-
- compiler->insn_shift = compiler->loop_shift;
- if (insn->flags & ORC_INSTRUCTION_FLAG_X2) {
- compiler->insn_shift += 1;
- }
- if (insn->flags & ORC_INSTRUCTION_FLAG_X4) {
- compiler->insn_shift += 2;
- }
-
- rule = insn->rule;
- if (rule && rule->emit) {
- rule->emit (compiler, rule->emit_user, insn);
- } else {
- orc_compiler_error (compiler, "no code generation rule for %s",
- opcode->name);
- }
- }
-}
-