tcg/aarch64: Massage tcg_out_brcond()
In order to ease next commit review, modify tcg_out_brcond() to switch over TCGCond. No logical change intended. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20240119224737.48943-1-philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
339adf2f38
commit
a0f5b3fc27
@ -1416,12 +1416,20 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a,
|
|||||||
TCGArg b, bool b_const, TCGLabel *l)
|
TCGArg b, bool b_const, TCGLabel *l)
|
||||||
{
|
{
|
||||||
intptr_t offset;
|
intptr_t offset;
|
||||||
bool need_cmp;
|
bool need_cmp = true;
|
||||||
|
|
||||||
if (b_const && b == 0 && (c == TCG_COND_EQ || c == TCG_COND_NE)) {
|
switch (c) {
|
||||||
need_cmp = false;
|
case TCG_COND_EQ:
|
||||||
} else {
|
case TCG_COND_NE:
|
||||||
need_cmp = true;
|
if (b_const && b == 0) {
|
||||||
|
need_cmp = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (need_cmp) {
|
||||||
tcg_out_cmp(s, ext, c, a, b, b_const);
|
tcg_out_cmp(s, ext, c, a, b, b_const);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1435,10 +1443,17 @@ static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a,
|
|||||||
|
|
||||||
if (need_cmp) {
|
if (need_cmp) {
|
||||||
tcg_out_insn(s, 3202, B_C, c, offset);
|
tcg_out_insn(s, 3202, B_C, c, offset);
|
||||||
} else if (c == TCG_COND_EQ) {
|
|
||||||
tcg_out_insn(s, 3201, CBZ, ext, a, offset);
|
|
||||||
} else {
|
} else {
|
||||||
tcg_out_insn(s, 3201, CBNZ, ext, a, offset);
|
switch (c) {
|
||||||
|
case TCG_COND_EQ:
|
||||||
|
tcg_out_insn(s, 3201, CBZ, ext, a, offset);
|
||||||
|
break;
|
||||||
|
case TCG_COND_NE:
|
||||||
|
tcg_out_insn(s, 3201, CBNZ, ext, a, offset);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_assert_not_reached();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user