mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-27 07:14:17 +08:00
Improve ?: expansion a little
there's no need to prematurely convert the condition into registers before emitting the test.
This commit is contained in:
parent
91e297acd3
commit
9264f06efe
13
tccgen.c
13
tccgen.c
@ -5797,19 +5797,6 @@ static void expr_cond(void)
|
|||||||
} else if (c < 0) {
|
} else if (c < 0) {
|
||||||
/* needed to avoid having different registers saved in
|
/* needed to avoid having different registers saved in
|
||||||
each branch */
|
each branch */
|
||||||
rc = RC_INT;
|
|
||||||
if (is_float(vtop->type.t)) {
|
|
||||||
rc = RC_FLOAT;
|
|
||||||
#ifdef TCC_TARGET_X86_64
|
|
||||||
if ((vtop->type.t & VT_BTYPE) == VT_LDOUBLE) {
|
|
||||||
rc = RC_ST0;
|
|
||||||
}
|
|
||||||
#elif defined TCC_TARGET_RISCV64
|
|
||||||
if ((vtop->type.t & VT_BTYPE) == VT_LDOUBLE)
|
|
||||||
rc = RC_INT;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
gv(rc);
|
|
||||||
save_regs(1);
|
save_regs(1);
|
||||||
gv_dup();
|
gv_dup();
|
||||||
tt = gvtst(0, 0);
|
tt = gvtst(0, 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user