Browse Source

change conditions for local and frame patterns to account for the case when

the use of the value is compiled before its first definition
cache-refactoring
Aleksey Demakov 18 years ago
parent
commit
08343ad1d8
  1. 8
      ChangeLog
  2. 15
      tools/gen-rules-parser.y

8
ChangeLog

@ -15,6 +15,14 @@
(clobbers_register, spill_clobbered_register, _jit_regs_gen): fix
a problem that shows up with the new cleanup method.
* tools/gen-rules-parser.y (gensel_output_clauses): the conditions
for the local and frame patterns are changed. If the value is used
before it is defined then both in_frame and in_register flags are
clear. This situation is perfectly valid if there is a backward
branch form a point after the definition to a point before the use.
So if the value is not a constant and it is not in a register assume
that it is on the stack even if the in_frame flag is not set.
2007-02-10 Klaus Treichel <ktreichel@web.de>
* jit/jit-function.c: Use the on-demand compilation driver in

15
tools/gen-rules-parser.y

@ -1104,8 +1104,9 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio
{
printf(" && ");
}
printf("insn->%s->in_frame && !insn->%s->in_register",
args[index], args[index]);
printf("!insn->%s->is_constant && ", args[index]);
printf("!insn->%s->in_register && ", args[index]);
printf("!insn->%s->has_global_register", args[index]);
seen_option = 1;
++index;
break;
@ -1115,7 +1116,8 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio
{
printf(" && ");
}
printf("!insn->%s->is_constant", args[index]);
printf("!insn->%s->is_constant && ", args[index]);
printf("!insn->%s->has_global_register", args[index]);
seen_option = 1;
++index;
break;
@ -1281,15 +1283,18 @@ static void gensel_output_clauses(gensel_clause_t clauses, gensel_option_t optio
case GENSEL_PATT_IMMU8:
case GENSEL_PATT_IMMS16:
case GENSEL_PATT_IMMU16:
++index;
break;
case GENSEL_PATT_LOCAL:
printf("\t\t_jit_gen_fix_value(insn->%s);\n", args[index]);
++index;
break;
case GENSEL_PATT_FRAME:
printf("\t\t_jit_regs_force_out(gen, insn->%s, %d);\n",
args[index], (free_dest && index == 0));
printf("\t\t_jit_gen_fix_value(insn->%s);\n",
args[index]);
printf("\t\t_jit_gen_fix_value(insn->%s);\n", args[index]);
++index;
break;

Loading…
Cancel
Save