for(i=0;i<compiler->n_insns;i++) {
OrcInstruction *insn = compiler->insns + i;
- insn->rule = orc_target_get_rule (compiler->target, insn->opcode);
+ insn->rule = orc_target_get_rule (compiler->target, insn->opcode,
+ compiler->target_flags);
if (insn->rule == NULL || insn->rule->emit == NULL) {
ORC_PROGRAM_ERROR(compiler, "No rule for: %s", insn->opcode->name);
}
OrcRule *
-orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode)
+orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode,
+ unsigned int target_flags)
{
OrcRule *rule;
int i;
for(i=0;i<target->n_rule_sets;i++){
if (target->rule_sets[i].opcode_set != opcode_sets + k) continue;
+ if (target->rule_sets[i].required_target_flags & (~target_flags)) continue;
rule = target->rule_sets[i].rules + j;
if (rule->emit) return rule;
unsigned int required_flags);
void orc_rule_register (OrcRuleSet *rule_set, const char *opcode_name,
OrcRuleEmitFunc emit, void *emit_user);
-OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode);
+OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode,
+ unsigned int target_flags);
OrcTarget * orc_target_get_default (void);
int orc_program_allocate_register (OrcProgram *program, int is_data);