#define GENSEL_OPT_TERNARY 7
#define GENSEL_OPT_STACK 8
#define GENSEL_OPT_ONLY 9
-#define GENSEL_OPT_COMMUTATIVE 10
+#define GENSEL_OPT_COPY 10
+#define GENSEL_OPT_X87ARITH 11
+#define GENSEL_OPT_COMMUTATIVE 12
+#define GENSEL_OPT_REVERSIBLE 13
-#define GENSEL_OPT_MANUAL 11
-#define GENSEL_OPT_MORE_SPACE 12
-#define GENSEL_OPT_SPILL_BEFORE 13
+#define GENSEL_OPT_MANUAL 14
+#define GENSEL_OPT_MORE_SPACE 15
+#define GENSEL_OPT_SPILL_BEFORE 16
/*
* Pattern values.
}
printf("_JIT_REGS_TERNARY");
}
- if(gensel_search_option(options, GENSEL_OPT_COMMUTATIVE))
+ if(gensel_search_option(options, GENSEL_OPT_BINARY_BRANCH)
+ || gensel_search_option(options, GENSEL_OPT_UNARY_BRANCH))
{
if(seen_option)
{
{
seen_option = 1;
}
- printf("_JIT_REGS_COMMUTATIVE");
+ printf("_JIT_REGS_BRANCH");
+ }
+ if(gensel_search_option(options, GENSEL_OPT_COPY))
+ {
+ if(seen_option)
+ {
+ printf(" | ");
+ }
+ else
+ {
+ seen_option = 1;
+ }
+ printf("_JIT_REGS_COPY");
}
if(gensel_search_option(options, GENSEL_OPT_STACK))
{
}
printf("_JIT_REGS_STACK");
}
-/*
- if(gensel_search_option(options, GENSEL_OPT_))
+ if(gensel_search_option(options, GENSEL_OPT_X87ARITH))
+ {
+ if(seen_option)
+ {
+ printf(" | ");
+ }
+ else
+ {
+ seen_option = 1;
+ }
+ printf("_JIT_REGS_X87_ARITH");
+ }
+ if(gensel_search_option(options, GENSEL_OPT_COMMUTATIVE))
+ {
+ if(seen_option)
+ {
+ printf(" | ");
+ }
+ else
+ {
+ seen_option = 1;
+ }
+ printf("_JIT_REGS_COMMUTATIVE");
+ }
+ if(gensel_search_option(options, GENSEL_OPT_REVERSIBLE))
{
if(seen_option)
{
{
seen_option = 1;
}
- printf("_JIT_REGS_");
+ printf("_JIT_REGS_REVERSIBLE");
}
-*/
if(!seen_option)
{
printf("0");
}
printf(");\n");
+ if(!(gensel_search_option(options, GENSEL_OPT_TERNARY)
+ || gensel_search_option(options, GENSEL_OPT_BINARY_NOTE)
+ || gensel_search_option(options, GENSEL_OPT_BINARY_BRANCH)
+ || gensel_search_option(options, GENSEL_OPT_UNARY_NOTE)
+ || gensel_search_option(options, GENSEL_OPT_UNARY_BRANCH)))
+ {
+ printf("\t\t_jit_regs_set_dest(®s, insn, 0, -1, -1);\n");
+ }
+
regs = 0;
index = 0;
pattern = clause->pattern;
printf("\t\t%s = _jit_regs_lookup(\"%s\")];\n",
gensel_reg_names[regs],
pattern->values->value);
- printf("\t\t_jit_regs_set_%s(®s, insn, %s, -1);\n",
+ printf("\t\t_jit_regs_set_%s(®s, insn, 0, %s, -1);\n",
args[index], gensel_reg_names[regs]);
}
else
{
- printf("\t\t_jit_regs_set_%s(®s, insn, -1, -1);\n",
+ printf("\t\t_jit_regs_set_%s(®s, insn, 0, -1, -1);\n",
args[index]);
}
++regs;
printf("\t\t%s = _jit_regs_lookup(\"%s\")];\n",
gensel_other_reg_names[regs],
pattern->values->next->value);
- printf("\t\t_jit_regs_set_%s(®s, insn, %s, %s);\n",
+ printf("\t\t_jit_regs_set_%s(®s, insn, 0, %s, %s);\n",
args[index],
gensel_reg_names[regs],
gensel_other_reg_names[regs]);
printf("\t\t%s = _jit_regs_lookup(\"%s\")];\n",
gensel_reg_names[regs],
pattern->values->value);
- printf("\t\t_jit_regs_set_%s(®s, insn, %s, -1);\n",
+ printf("\t\t_jit_regs_set_%s(®s, insn, 0, %s, -1);\n",
args[index], gensel_reg_names[regs]);
}
}
else
{
- printf("\t\t_jit_regs_set_%s(®s, insn, -1, -1);\n",
+ printf("\t\t_jit_regs_set_%s(®s, insn, 0, -1, -1);\n",
args[index]);
}
++regs;
{
case GENSEL_PATT_REG:
case GENSEL_PATT_FREG:
- printf("\t\t%s = _jit_reg_info[_jit_regs_%s(regs)].cpu_reg;\n",
+ printf("\t\t%s = _jit_reg_info[_jit_regs_%s(®s)].cpu_reg;\n",
gensel_reg_names[regs], args[index]);
++regs;
++index;
break;
case GENSEL_PATT_LREG:
- printf("\t\t%s = _jit_reg_info[_jit_regs_%s(regs)].cpu_reg;\n",
+ printf("\t\t%s = _jit_reg_info[_jit_regs_%s(®s)].cpu_reg;\n",
gensel_reg_names[regs], args[index]);
- printf("\t\t%s = _jit_reg_info[_jit_regs_%s_other(regs)].cpu_reg;\n",
+ printf("\t\t%s = _jit_reg_info[_jit_regs_%s_other(®s)].cpu_reg;\n",
gensel_other_reg_names[regs], args[index]);
++regs;
++index;
%token K_TERNARY "`ternary'"
%token K_STACK "`stack'"
%token K_ONLY "`only'"
+%token K_COPY "`copy'"
+%token K_X87ARITH "`x87arith'"
%token K_COMMUTATIVE "`commutative'"
+%token K_REVERSIBLE "`reversible'"
%token K_IF "`if'"
%token K_CLOBBER "`clobber'"
%token K_SCRATCH "`scratch'"
| K_TERNARY { $$ = GENSEL_OPT_TERNARY; }
| K_STACK { $$ = GENSEL_OPT_STACK; }
| K_ONLY { $$ = GENSEL_OPT_ONLY; }
+ | K_COPY { $$ = GENSEL_OPT_COPY; }
+ | K_X87ARITH { $$ = GENSEL_OPT_X87ARITH; }
| K_COMMUTATIVE { $$ = GENSEL_OPT_COMMUTATIVE; }
+ | K_REVERSIBLE { $$ = GENSEL_OPT_REVERSIBLE; }
/* deprecated: */
| K_MANUAL { $$ = GENSEL_OPT_MANUAL; }