notaz.gp2x.de
/
ia32rtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
translate: more noreturn cases, neg flags
[ia32rtools.git]
/
tools
/
translate.c
diff --git
a/tools/translate.c
b/tools/translate.c
index
5e810a9
..
e8b1ba9
100644
(file)
--- a/
tools/translate.c
+++ b/
tools/translate.c
@@
-2583,10
+2583,10
@@
static int scan_for_pop(int i, int opcnt, int magic, int reg,
if (po->pp != NULL && po->pp->is_noreturn)
seen_noreturn = 1;
else
if (po->pp != NULL && po->pp->is_noreturn)
seen_noreturn = 1;
else
-
return -1
;
+
goto out
;
}
else
}
else
- return -1; // deadend
+ goto out;
}
if (po->flags & (OPF_RMD|OPF_DONE|OPF_FARG))
}
if (po->flags & (OPF_RMD|OPF_DONE|OPF_FARG))
@@
-2637,6
+2637,7
@@
static int scan_for_pop(int i, int opcnt, int magic, int reg,
}
}
}
}
+out:
// for noreturn, assume msvc skipped stack cleanup
return seen_noreturn ? 1 : -1;
}
// for noreturn, assume msvc skipped stack cleanup
return seen_noreturn ? 1 : -1;
}
@@
-6704,10
+6705,11
@@
static void gen_func(FILE *fout, FILE *fhdr, const char *funcn, int opcnt)
lmod_cast_s(po, po->operand[0].lmod), buf2);
last_arith_dst = &po->operand[0];
delayed_flag_op = NULL;
lmod_cast_s(po, po->operand[0].lmod), buf2);
last_arith_dst = &po->operand[0];
delayed_flag_op = NULL;
- if (pfomask &
(1 << PFO_C)
) {
+ if (pfomask &
PFOB_C
) {
fprintf(fout, "\n cond_c = (%s != 0);", buf1);
fprintf(fout, "\n cond_c = (%s != 0);", buf1);
- pfomask &= ~
(1 << PFO_C)
;
+ pfomask &= ~
PFOB_C
;
}
}
+ output_std_flags(fout, po, &pfomask, buf1);
break;
case OP_IMUL:
break;
case OP_IMUL:
@@
-6955,7
+6957,7
@@
static void gen_func(FILE *fout, FILE *fhdr, const char *funcn, int opcnt)
if (pp->arg[arg].type.is_retreg)
fprintf(fout, "&%s", pp->arg[arg].reg);
else if (IS(pp->arg[arg].reg, "ebp")
if (pp->arg[arg].type.is_retreg)
fprintf(fout, "&%s", pp->arg[arg].reg);
else if (IS(pp->arg[arg].reg, "ebp")
- && !(po->flags & OPF_EBP_S))
+ &&
g_bp_frame &&
!(po->flags & OPF_EBP_S))
{
// rare special case
fprintf(fout, "%s(u32)&sf.b[sizeof(sf)]", cast);
{
// rare special case
fprintf(fout, "%s(u32)&sf.b[sizeof(sf)]", cast);
@@
-7747,8
+7749,11
@@
static void gen_hdr_dep_pass(int i, int opcnt, unsigned char *cbits,
po->regmask_dst |= 1 << xAX;
dep = hg_fp_find_dep(fp, po->operand[0].name);
po->regmask_dst |= 1 << xAX;
dep = hg_fp_find_dep(fp, po->operand[0].name);
- if (dep != NULL)
+ if (dep != NULL)
{
dep->regmask_live = regmask_save | regmask_dst;
dep->regmask_live = regmask_save | regmask_dst;
+ if (g_bp_frame && !(po->flags & OPF_EBP_S))
+ dep->regmask_live |= 1 << xBP;
+ }
}
else if (po->op == OP_RET) {
if (po->operand_cnt > 0) {
}
else if (po->op == OP_RET) {
if (po->operand_cnt > 0) {